<html><body>
<style>

body, h1, h2, h3, div, span, p, pre, a {
  margin: 0;
  padding: 0;
  border: 0;
  font-weight: inherit;
  font-style: inherit;
  font-size: 100%;
  font-family: inherit;
  vertical-align: baseline;
}

body {
  font-size: 13px;
  padding: 1em;
}

h1 {
  font-size: 26px;
  margin-bottom: 1em;
}

h2 {
  font-size: 24px;
  margin-bottom: 1em;
}

h3 {
  font-size: 20px;
  margin-bottom: 1em;
  margin-top: 1em;
}

pre, code {
  line-height: 1.5;
  font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
}

pre {
  margin-top: 0.5em;
}

h1, h2, h3, p {
  font-family: Arial, sans serif;
}

h1, h2, h3 {
  border-bottom: solid #CCC 1px;
}

.toc_element {
  margin-top: 0.5em;
}

.firstline {
  margin-left: 2 em;
}

.method  {
  margin-top: 1em;
  border: solid 1px #CCC;
  padding: 1em;
  background: #EEE;
}

.details {
  font-weight: bold;
  font-size: 14px;
}

</style>

<h1><a href="aiplatform_v1.html">Vertex AI API</a> . <a href="aiplatform_v1.endpoints.html">endpoints</a></h1>
<h2>Instance Methods</h2>
<p class="toc_element">
  <code><a href="aiplatform_v1.endpoints.chat.html">chat()</a></code>
</p>
<p class="firstline">Returns the chat Resource.</p>

<p class="toc_element">
  <code><a href="aiplatform_v1.endpoints.operations.html">operations()</a></code>
</p>
<p class="firstline">Returns the operations Resource.</p>

<p class="toc_element">
  <code><a href="#close">close()</a></code></p>
<p class="firstline">Close httplib2 connections.</p>
<p class="toc_element">
  <code><a href="#computeTokens">computeTokens(endpoint, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Return a list of tokens based on the input text.</p>
<p class="toc_element">
  <code><a href="#countTokens">countTokens(endpoint, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Perform a token counting.</p>
<p class="toc_element">
  <code><a href="#fetchPredictOperation">fetchPredictOperation(endpoint, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Fetch an asynchronous online prediction operation.</p>
<p class="toc_element">
  <code><a href="#generateContent">generateContent(model, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Generate content with multimodal inputs.</p>
<p class="toc_element">
  <code><a href="#predict">predict(endpoint, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Perform an online prediction.</p>
<p class="toc_element">
  <code><a href="#predictLongRunning">predictLongRunning(endpoint, body=None, x__xgafv=None)</a></code></p>
<p class="firstline"></p>
<p class="toc_element">
  <code><a href="#streamGenerateContent">streamGenerateContent(model, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Generate content with multimodal inputs with streaming support.</p>
<h3>Method Details</h3>
<div class="method">
    <code class="details" id="close">close()</code>
  <pre>Close httplib2 connections.</pre>
</div>

<div class="method">
    <code class="details" id="computeTokens">computeTokens(endpoint, body=None, x__xgafv=None)</code>
  <pre>Return a list of tokens based on the input text.

Args:
  endpoint: string, Required. The name of the Endpoint requested to get lists of tokens and token ids. (required)
  body: object, The request body.
    The object takes the form of:

{ # Request message for ComputeTokens RPC call.
  &quot;contents&quot;: [ # Optional. Input content.
    { # The structured data content of a message. A Content message contains a `role` field, which indicates the producer of the content, and a `parts` field, which contains the multi-part data of the message.
      &quot;parts&quot;: [ # Required. A list of Part objects that make up a single message. Parts of a message can have different MIME types. A Content message must have at least one Part.
        { # A datatype containing media that is part of a multi-part Content message. A `Part` consists of data which has an associated datatype. A `Part` can only contain one of the accepted types in `Part.data`. For media types that are not text, `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if `inline_data` or `file_data` field is filled with raw bytes.
          &quot;codeExecutionResult&quot;: { # Result of executing the [ExecutableCode]. Only generated when using the [CodeExecution] tool, and always follows a `part` containing the [ExecutableCode]. # Optional. The result of executing the ExecutableCode.
            &quot;outcome&quot;: &quot;A String&quot;, # Required. Outcome of the code execution.
            &quot;output&quot;: &quot;A String&quot;, # Optional. Contains stdout when code execution is successful, stderr or other description otherwise.
          },
          &quot;executableCode&quot;: { # Code generated by the model that is meant to be executed, and the result returned to the model. Generated when using the [CodeExecution] tool, in which the code will be automatically executed, and a corresponding [CodeExecutionResult] will also be generated. # Optional. Code generated by the model that is intended to be executed.
            &quot;code&quot;: &quot;A String&quot;, # Required. The code to be executed.
            &quot;language&quot;: &quot;A String&quot;, # Required. Programming language of the `code`.
          },
          &quot;fileData&quot;: { # URI-based data. A FileData message contains a URI pointing to data of a specific media type. It is used to represent images, audio, and video stored in Google Cloud Storage. # Optional. The URI-based data of the part. This can be used to include files from Google Cloud Storage.
            &quot;displayName&quot;: &quot;A String&quot;, # Optional. The display name of the file. Used to provide a label or filename to distinguish files. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server side tools (`code_execution`, `google_search`, and `url_context`) are enabled.
            &quot;fileUri&quot;: &quot;A String&quot;, # Required. The URI of the file in Google Cloud Storage.
            &quot;mimeType&quot;: &quot;A String&quot;, # Required. The IANA standard MIME type of the source data.
          },
          &quot;functionCall&quot;: { # A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing the parameters and their values. # Optional. A predicted function call returned from the model. This contains the name of the function to call and the arguments to pass to the function.
            &quot;args&quot;: { # Optional. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.
              &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
            },
            &quot;name&quot;: &quot;A String&quot;, # Optional. The name of the function to call. Matches [FunctionDeclaration.name].
          },
          &quot;functionResponse&quot;: { # The result output from a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a [FunctionCall] made based on model prediction. # Optional. The result of a function call. This is used to provide the model with the result of a function call that it predicted.
            &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].
            &quot;parts&quot;: [ # Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types.
              { # A datatype containing media that is part of a `FunctionResponse` message. A `FunctionResponsePart` consists of data which has an associated datatype. A `FunctionResponsePart` can only contain one of the accepted types in `FunctionResponsePart.data`. A `FunctionResponsePart` must have a fixed IANA MIME type identifying the type and subtype of the media if the `inline_data` field is filled with raw bytes.
                &quot;fileData&quot;: { # URI based data for function response. # URI based data.
                  &quot;displayName&quot;: &quot;A String&quot;, # Optional. Display name of the file data. Used to provide a label or filename to distinguish file datas. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled.
                  &quot;fileUri&quot;: &quot;A String&quot;, # Required. URI.
                  &quot;mimeType&quot;: &quot;A String&quot;, # Required. The IANA standard MIME type of the source data.
                },
                &quot;inlineData&quot;: { # Raw media bytes for function response. Text should not be sent as raw bytes, use the &#x27;text&#x27; field. # Inline media bytes.
                  &quot;data&quot;: &quot;A String&quot;, # Required. Raw bytes.
                  &quot;displayName&quot;: &quot;A String&quot;, # Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled.
                  &quot;mimeType&quot;: &quot;A String&quot;, # Required. The IANA standard MIME type of the source data.
                },
              },
            ],
            &quot;response&quot;: { # Required. The function response in JSON object format. Use &quot;output&quot; key to specify function output and &quot;error&quot; key to specify error details (if any). If &quot;output&quot; and &quot;error&quot; keys are not specified, then whole &quot;response&quot; is treated as function output.
              &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
            },
          },
          &quot;inlineData&quot;: { # A content blob. A Blob contains data of a specific media type. It is used to represent images, audio, and video. # Optional. The inline data content of the part. This can be used to include images, audio, or video in a request.
            &quot;data&quot;: &quot;A String&quot;, # Required. The raw bytes of the data.
            &quot;displayName&quot;: &quot;A String&quot;, # Optional. The display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server-side tools (`code_execution`, `google_search`, and `url_context`) are enabled.
            &quot;mimeType&quot;: &quot;A String&quot;, # Required. The IANA standard MIME type of the source data.
          },
          &quot;text&quot;: &quot;A String&quot;, # Optional. The text content of the part.
          &quot;thought&quot;: True or False, # Optional. Indicates whether the `part` represents the model&#x27;s thought process or reasoning.
          &quot;thoughtSignature&quot;: &quot;A String&quot;, # Optional. An opaque signature for the thought so it can be reused in subsequent requests.
          &quot;videoMetadata&quot;: { # Provides metadata for a video, including the start and end offsets for clipping and the frame rate. # Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.
            &quot;endOffset&quot;: &quot;A String&quot;, # Optional. The end offset of the video.
            &quot;fps&quot;: 3.14, # Optional. The frame rate of the video sent to the model. If not specified, the default value is 1.0. The valid range is (0.0, 24.0].
            &quot;startOffset&quot;: &quot;A String&quot;, # Optional. The start offset of the video.
          },
        },
      ],
      &quot;role&quot;: &quot;A String&quot;, # Optional. The producer of the content. Must be either &#x27;user&#x27; or &#x27;model&#x27;. If not set, the service will default to &#x27;user&#x27;.
    },
  ],
  &quot;instances&quot;: [ # Optional. The instances that are the input to token computing API call. Schema is identical to the prediction schema of the text model, even for the non-text models, like chat models, or Codey models.
    &quot;&quot;,
  ],
  &quot;model&quot;: &quot;A String&quot;, # Optional. The name of the publisher model requested to serve the prediction. Format: projects/{project}/locations/{location}/publishers/*/models/*
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Response message for ComputeTokens RPC call.
  &quot;tokensInfo&quot;: [ # Lists of tokens info from the input. A ComputeTokensRequest could have multiple instances with a prompt in each instance. We also need to return lists of tokens info for the request with multiple instances.
    { # Tokens info with a list of tokens and the corresponding list of token ids.
      &quot;role&quot;: &quot;A String&quot;, # Optional. Optional fields for the role from the corresponding Content.
      &quot;tokenIds&quot;: [ # A list of token ids from the input.
        &quot;A String&quot;,
      ],
      &quot;tokens&quot;: [ # A list of tokens from the input.
        &quot;A String&quot;,
      ],
    },
  ],
}</pre>
</div>

<div class="method">
    <code class="details" id="countTokens">countTokens(endpoint, body=None, x__xgafv=None)</code>
  <pre>Perform a token counting.

Args:
  endpoint: string, Required. The name of the Endpoint requested to perform token counting. Format: `projects/{project}/locations/{location}/endpoints/{endpoint}` (required)
  body: object, The request body.
    The object takes the form of:

{ # Request message for PredictionService.CountTokens.
  &quot;contents&quot;: [ # Optional. Input content.
    { # The structured data content of a message. A Content message contains a `role` field, which indicates the producer of the content, and a `parts` field, which contains the multi-part data of the message.
      &quot;parts&quot;: [ # Required. A list of Part objects that make up a single message. Parts of a message can have different MIME types. A Content message must have at least one Part.
        { # A datatype containing media that is part of a multi-part Content message. A `Part` consists of data which has an associated datatype. A `Part` can only contain one of the accepted types in `Part.data`. For media types that are not text, `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if `inline_data` or `file_data` field is filled with raw bytes.
          &quot;codeExecutionResult&quot;: { # Result of executing the [ExecutableCode]. Only generated when using the [CodeExecution] tool, and always follows a `part` containing the [ExecutableCode]. # Optional. The result of executing the ExecutableCode.
            &quot;outcome&quot;: &quot;A String&quot;, # Required. Outcome of the code execution.
            &quot;output&quot;: &quot;A String&quot;, # Optional. Contains stdout when code execution is successful, stderr or other description otherwise.
          },
          &quot;executableCode&quot;: { # Code generated by the model that is meant to be executed, and the result returned to the model. Generated when using the [CodeExecution] tool, in which the code will be automatically executed, and a corresponding [CodeExecutionResult] will also be generated. # Optional. Code generated by the model that is intended to be executed.
            &quot;code&quot;: &quot;A String&quot;, # Required. The code to be executed.
            &quot;language&quot;: &quot;A String&quot;, # Required. Programming language of the `code`.
          },
          &quot;fileData&quot;: { # URI-based data. A FileData message contains a URI pointing to data of a specific media type. It is used to represent images, audio, and video stored in Google Cloud Storage. # Optional. The URI-based data of the part. This can be used to include files from Google Cloud Storage.
            &quot;displayName&quot;: &quot;A String&quot;, # Optional. The display name of the file. Used to provide a label or filename to distinguish files. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server side tools (`code_execution`, `google_search`, and `url_context`) are enabled.
            &quot;fileUri&quot;: &quot;A String&quot;, # Required. The URI of the file in Google Cloud Storage.
            &quot;mimeType&quot;: &quot;A String&quot;, # Required. The IANA standard MIME type of the source data.
          },
          &quot;functionCall&quot;: { # A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing the parameters and their values. # Optional. A predicted function call returned from the model. This contains the name of the function to call and the arguments to pass to the function.
            &quot;args&quot;: { # Optional. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.
              &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
            },
            &quot;name&quot;: &quot;A String&quot;, # Optional. The name of the function to call. Matches [FunctionDeclaration.name].
          },
          &quot;functionResponse&quot;: { # The result output from a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a [FunctionCall] made based on model prediction. # Optional. The result of a function call. This is used to provide the model with the result of a function call that it predicted.
            &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].
            &quot;parts&quot;: [ # Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types.
              { # A datatype containing media that is part of a `FunctionResponse` message. A `FunctionResponsePart` consists of data which has an associated datatype. A `FunctionResponsePart` can only contain one of the accepted types in `FunctionResponsePart.data`. A `FunctionResponsePart` must have a fixed IANA MIME type identifying the type and subtype of the media if the `inline_data` field is filled with raw bytes.
                &quot;fileData&quot;: { # URI based data for function response. # URI based data.
                  &quot;displayName&quot;: &quot;A String&quot;, # Optional. Display name of the file data. Used to provide a label or filename to distinguish file datas. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled.
                  &quot;fileUri&quot;: &quot;A String&quot;, # Required. URI.
                  &quot;mimeType&quot;: &quot;A String&quot;, # Required. The IANA standard MIME type of the source data.
                },
                &quot;inlineData&quot;: { # Raw media bytes for function response. Text should not be sent as raw bytes, use the &#x27;text&#x27; field. # Inline media bytes.
                  &quot;data&quot;: &quot;A String&quot;, # Required. Raw bytes.
                  &quot;displayName&quot;: &quot;A String&quot;, # Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled.
                  &quot;mimeType&quot;: &quot;A String&quot;, # Required. The IANA standard MIME type of the source data.
                },
              },
            ],
            &quot;response&quot;: { # Required. The function response in JSON object format. Use &quot;output&quot; key to specify function output and &quot;error&quot; key to specify error details (if any). If &quot;output&quot; and &quot;error&quot; keys are not specified, then whole &quot;response&quot; is treated as function output.
              &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
            },
          },
          &quot;inlineData&quot;: { # A content blob. A Blob contains data of a specific media type. It is used to represent images, audio, and video. # Optional. The inline data content of the part. This can be used to include images, audio, or video in a request.
            &quot;data&quot;: &quot;A String&quot;, # Required. The raw bytes of the data.
            &quot;displayName&quot;: &quot;A String&quot;, # Optional. The display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server-side tools (`code_execution`, `google_search`, and `url_context`) are enabled.
            &quot;mimeType&quot;: &quot;A String&quot;, # Required. The IANA standard MIME type of the source data.
          },
          &quot;text&quot;: &quot;A String&quot;, # Optional. The text content of the part.
          &quot;thought&quot;: True or False, # Optional. Indicates whether the `part` represents the model&#x27;s thought process or reasoning.
          &quot;thoughtSignature&quot;: &quot;A String&quot;, # Optional. An opaque signature for the thought so it can be reused in subsequent requests.
          &quot;videoMetadata&quot;: { # Provides metadata for a video, including the start and end offsets for clipping and the frame rate. # Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.
            &quot;endOffset&quot;: &quot;A String&quot;, # Optional. The end offset of the video.
            &quot;fps&quot;: 3.14, # Optional. The frame rate of the video sent to the model. If not specified, the default value is 1.0. The valid range is (0.0, 24.0].
            &quot;startOffset&quot;: &quot;A String&quot;, # Optional. The start offset of the video.
          },
        },
      ],
      &quot;role&quot;: &quot;A String&quot;, # Optional. The producer of the content. Must be either &#x27;user&#x27; or &#x27;model&#x27;. If not set, the service will default to &#x27;user&#x27;.
    },
  ],
  &quot;generationConfig&quot;: { # Configuration for content generation. This message contains all the parameters that control how the model generates content. It allows you to influence the randomness, length, and structure of the output. # Optional. Generation config that the model will use to generate the response.
    &quot;audioTimestamp&quot;: True or False, # Optional. If enabled, audio timestamps will be included in the request to the model. This can be useful for synchronizing audio with other modalities in the response.
    &quot;candidateCount&quot;: 42, # Optional. The number of candidate responses to generate. A higher `candidate_count` can provide more options to choose from, but it also consumes more resources. This can be useful for generating a variety of responses and selecting the best one.
    &quot;enableAffectiveDialog&quot;: True or False, # Optional. If enabled, the model will detect emotions and adapt its responses accordingly. For example, if the model detects that the user is frustrated, it may provide a more empathetic response.
    &quot;frequencyPenalty&quot;: 3.14, # Optional. Penalizes tokens based on their frequency in the generated text. A positive value helps to reduce the repetition of words and phrases. Valid values can range from [-2.0, 2.0].
    &quot;imageConfig&quot;: { # Configuration for image generation. This message allows you to control various aspects of image generation, such as the output format, aspect ratio, and whether the model can generate images of people. # Optional. Config for image generation features.
      &quot;aspectRatio&quot;: &quot;A String&quot;, # Optional. The desired aspect ratio for the generated images. The following aspect ratios are supported: &quot;1:1&quot; &quot;2:3&quot;, &quot;3:2&quot; &quot;3:4&quot;, &quot;4:3&quot; &quot;4:5&quot;, &quot;5:4&quot; &quot;9:16&quot;, &quot;16:9&quot; &quot;21:9&quot;
      &quot;imageOutputOptions&quot;: { # The image output format for generated images. # Optional. The image output format for generated images.
        &quot;compressionQuality&quot;: 42, # Optional. The compression quality of the output image.
        &quot;mimeType&quot;: &quot;A String&quot;, # Optional. The image format that the output should be saved as.
      },
      &quot;personGeneration&quot;: &quot;A String&quot;, # Optional. Controls whether the model can generate people.
    },
    &quot;logprobs&quot;: 42, # Optional. The number of top log probabilities to return for each token. This can be used to see which other tokens were considered likely candidates for a given position. A higher value will return more options, but it will also increase the size of the response.
    &quot;maxOutputTokens&quot;: 42, # Optional. The maximum number of tokens to generate in the response. A token is approximately four characters. The default value varies by model. This parameter can be used to control the length of the generated text and prevent overly long responses.
    &quot;mediaResolution&quot;: &quot;A String&quot;, # Optional. The token resolution at which input media content is sampled. This is used to control the trade-off between the quality of the response and the number of tokens used to represent the media. A higher resolution allows the model to perceive more detail, which can lead to a more nuanced response, but it will also use more tokens. This does not affect the image dimensions sent to the model.
    &quot;presencePenalty&quot;: 3.14, # Optional. Penalizes tokens that have already appeared in the generated text. A positive value encourages the model to generate more diverse and less repetitive text. Valid values can range from [-2.0, 2.0].
    &quot;responseJsonSchema&quot;: &quot;&quot;, # Optional. When this field is set, response_schema must be omitted and response_mime_type must be set to `application/json`.
    &quot;responseLogprobs&quot;: True or False, # Optional. If set to true, the log probabilities of the output tokens are returned. Log probabilities are the logarithm of the probability of a token appearing in the output. A higher log probability means the token is more likely to be generated. This can be useful for analyzing the model&#x27;s confidence in its own output and for debugging.
    &quot;responseMimeType&quot;: &quot;A String&quot;, # Optional. The IANA standard MIME type of the response. The model will generate output that conforms to this MIME type. Supported values include &#x27;text/plain&#x27; (default) and &#x27;application/json&#x27;. The model needs to be prompted to output the appropriate response type, otherwise the behavior is undefined. This is a preview feature.
    &quot;responseModalities&quot;: [ # Optional. The modalities of the response. The model will generate a response that includes all the specified modalities. For example, if this is set to `[TEXT, IMAGE]`, the response will include both text and an image.
      &quot;A String&quot;,
    ],
    &quot;responseSchema&quot;: { # Schema is used to define the format of input/output data. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may be added in the future as needed. # Optional. Lets you to specify a schema for the model&#x27;s response, ensuring that the output conforms to a particular structure. This is useful for generating structured data such as JSON. The schema is a subset of the [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema) object. When this field is set, you must also set the `response_mime_type` to `application/json`.
      &quot;additionalProperties&quot;: &quot;&quot;, # Optional. Can either be a boolean or an object; controls the presence of additional properties.
      &quot;anyOf&quot;: [ # Optional. The value should be validated against any (one or more) of the subschemas in the list.
        # Object with schema name: GoogleCloudAiplatformV1Schema
      ],
      &quot;default&quot;: &quot;&quot;, # Optional. Default value of the data.
      &quot;defs&quot;: { # Optional. A map of definitions for use by `ref` Only allowed at the root of the schema.
        &quot;a_key&quot;: # Object with schema name: GoogleCloudAiplatformV1Schema
      },
      &quot;description&quot;: &quot;A String&quot;, # Optional. The description of the data.
      &quot;enum&quot;: [ # Optional. Possible values of the element of primitive type with enum format. Examples: 1. We can define direction as : {type:STRING, format:enum, enum:[&quot;EAST&quot;, NORTH&quot;, &quot;SOUTH&quot;, &quot;WEST&quot;]} 2. We can define apartment number as : {type:INTEGER, format:enum, enum:[&quot;101&quot;, &quot;201&quot;, &quot;301&quot;]}
        &quot;A String&quot;,
      ],
      &quot;example&quot;: &quot;&quot;, # Optional. Example of the object. Will only populated when the object is the root.
      &quot;format&quot;: &quot;A String&quot;, # Optional. The format of the data. Supported formats: for NUMBER type: &quot;float&quot;, &quot;double&quot; for INTEGER type: &quot;int32&quot;, &quot;int64&quot; for STRING type: &quot;email&quot;, &quot;byte&quot;, etc
      &quot;items&quot;: # Object with schema name: GoogleCloudAiplatformV1Schema # Optional. SCHEMA FIELDS FOR TYPE ARRAY Schema of the elements of Type.ARRAY.
      &quot;maxItems&quot;: &quot;A String&quot;, # Optional. Maximum number of the elements for Type.ARRAY.
      &quot;maxLength&quot;: &quot;A String&quot;, # Optional. Maximum length of the Type.STRING
      &quot;maxProperties&quot;: &quot;A String&quot;, # Optional. Maximum number of the properties for Type.OBJECT.
      &quot;maximum&quot;: 3.14, # Optional. Maximum value of the Type.INTEGER and Type.NUMBER
      &quot;minItems&quot;: &quot;A String&quot;, # Optional. Minimum number of the elements for Type.ARRAY.
      &quot;minLength&quot;: &quot;A String&quot;, # Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING
      &quot;minProperties&quot;: &quot;A String&quot;, # Optional. Minimum number of the properties for Type.OBJECT.
      &quot;minimum&quot;: 3.14, # Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER
      &quot;nullable&quot;: True or False, # Optional. Indicates if the value may be null.
      &quot;pattern&quot;: &quot;A String&quot;, # Optional. Pattern of the Type.STRING to restrict a string to a regular expression.
      &quot;properties&quot;: { # Optional. SCHEMA FIELDS FOR TYPE OBJECT Properties of Type.OBJECT.
        &quot;a_key&quot;: # Object with schema name: GoogleCloudAiplatformV1Schema
      },
      &quot;propertyOrdering&quot;: [ # Optional. The order of the properties. Not a standard field in open api spec. Only used to support the order of the properties.
        &quot;A String&quot;,
      ],
      &quot;ref&quot;: &quot;A String&quot;, # Optional. Allows indirect references between schema nodes. The value should be a valid reference to a child of the root `defs`. For example, the following schema defines a reference to a schema node named &quot;Pet&quot;: type: object properties: pet: ref: #/defs/Pet defs: Pet: type: object properties: name: type: string The value of the &quot;pet&quot; property is a reference to the schema node named &quot;Pet&quot;. See details in https://json-schema.org/understanding-json-schema/structuring
      &quot;required&quot;: [ # Optional. Required properties of Type.OBJECT.
        &quot;A String&quot;,
      ],
      &quot;title&quot;: &quot;A String&quot;, # Optional. The title of the Schema.
      &quot;type&quot;: &quot;A String&quot;, # Optional. The type of the data.
    },
    &quot;routingConfig&quot;: { # The configuration for routing the request to a specific model. This can be used to control which model is used for the generation, either automatically or by specifying a model name. # Optional. Routing configuration.
      &quot;autoMode&quot;: { # The configuration for automated routing. When automated routing is specified, the routing will be determined by the pretrained routing model and customer provided model routing preference. # In this mode, the model is selected automatically based on the content of the request.
        &quot;modelRoutingPreference&quot;: &quot;A String&quot;, # The model routing preference.
      },
      &quot;manualMode&quot;: { # The configuration for manual routing. When manual routing is specified, the model will be selected based on the model name provided. # In this mode, the model is specified manually.
        &quot;modelName&quot;: &quot;A String&quot;, # The name of the model to use. Only public LLM models are accepted.
      },
    },
    &quot;seed&quot;: 42, # Optional. A seed for the random number generator. By setting a seed, you can make the model&#x27;s output mostly deterministic. For a given prompt and parameters (like temperature, top_p, etc.), the model will produce the same response every time. However, it&#x27;s not a guaranteed absolute deterministic behavior. This is different from parameters like `temperature`, which control the *level* of randomness. `seed` ensures that the &quot;random&quot; choices the model makes are the same on every run, making it essential for testing and ensuring reproducible results.
    &quot;speechConfig&quot;: { # Configuration for speech generation. # Optional. The speech generation config.
      &quot;languageCode&quot;: &quot;A String&quot;, # Optional. The language code (ISO 639-1) for the speech synthesis.
      &quot;multiSpeakerVoiceConfig&quot;: { # Configuration for a multi-speaker text-to-speech request. # The configuration for a multi-speaker text-to-speech request. This field is mutually exclusive with `voice_config`.
        &quot;speakerVoiceConfigs&quot;: [ # Required. A list of configurations for the voices of the speakers. Exactly two speaker voice configurations must be provided.
          { # Configuration for a single speaker in a multi-speaker setup.
            &quot;speaker&quot;: &quot;A String&quot;, # Required. The name of the speaker. This should be the same as the speaker name used in the prompt.
            &quot;voiceConfig&quot;: { # Configuration for a voice. # Required. The configuration for the voice of this speaker.
              &quot;prebuiltVoiceConfig&quot;: { # Configuration for a prebuilt voice. # The configuration for a prebuilt voice.
                &quot;voiceName&quot;: &quot;A String&quot;, # The name of the prebuilt voice to use.
              },
            },
          },
        ],
      },
      &quot;voiceConfig&quot;: { # Configuration for a voice. # The configuration for the voice to use.
        &quot;prebuiltVoiceConfig&quot;: { # Configuration for a prebuilt voice. # The configuration for a prebuilt voice.
          &quot;voiceName&quot;: &quot;A String&quot;, # The name of the prebuilt voice to use.
        },
      },
    },
    &quot;stopSequences&quot;: [ # Optional. A list of character sequences that will stop the model from generating further tokens. If a stop sequence is generated, the output will end at that point. This is useful for controlling the length and structure of the output. For example, you can use [&quot;\n&quot;, &quot;###&quot;] to stop generation at a new line or a specific marker.
      &quot;A String&quot;,
    ],
    &quot;temperature&quot;: 3.14, # Optional. Controls the randomness of the output. A higher temperature results in more creative and diverse responses, while a lower temperature makes the output more predictable and focused. The valid range is (0.0, 2.0].
    &quot;thinkingConfig&quot;: { # Configuration for the model&#x27;s thinking features. &quot;Thinking&quot; is a process where the model breaks down a complex task into smaller, manageable steps. This allows the model to reason about the task, plan its approach, and execute the plan to generate a high-quality response. # Optional. Configuration for thinking features. An error will be returned if this field is set for models that don&#x27;t support thinking.
      &quot;includeThoughts&quot;: True or False, # Optional. If true, the model will include its thoughts in the response. &quot;Thoughts&quot; are the intermediate steps the model takes to arrive at the final response. They can provide insights into the model&#x27;s reasoning process and help with debugging. If this is true, thoughts are returned only when available.
      &quot;thinkingBudget&quot;: 42, # Optional. The token budget for the model&#x27;s thinking process. The model will make a best effort to stay within this budget. This can be used to control the trade-off between response quality and latency.
    },
    &quot;topK&quot;: 3.14, # Optional. Specifies the top-k sampling threshold. The model considers only the top k most probable tokens for the next token. This can be useful for generating more coherent and less random text. For example, a `top_k` of 40 means the model will choose the next word from the 40 most likely words.
    &quot;topP&quot;: 3.14, # Optional. Specifies the nucleus sampling threshold. The model considers only the smallest set of tokens whose cumulative probability is at least `top_p`. This helps generate more diverse and less repetitive responses. For example, a `top_p` of 0.9 means the model considers tokens until the cumulative probability of the tokens to select from reaches 0.9. It&#x27;s recommended to adjust either temperature or `top_p`, but not both.
  },
  &quot;instances&quot;: [ # Optional. The instances that are the input to token counting call. Schema is identical to the prediction schema of the underlying model.
    &quot;&quot;,
  ],
  &quot;model&quot;: &quot;A String&quot;, # Optional. The name of the publisher model requested to serve the prediction. Format: `projects/{project}/locations/{location}/publishers/*/models/*`
  &quot;systemInstruction&quot;: { # The structured data content of a message. A Content message contains a `role` field, which indicates the producer of the content, and a `parts` field, which contains the multi-part data of the message. # Optional. The user provided system instructions for the model. Note: only text should be used in parts and content in each part will be in a separate paragraph.
    &quot;parts&quot;: [ # Required. A list of Part objects that make up a single message. Parts of a message can have different MIME types. A Content message must have at least one Part.
      { # A datatype containing media that is part of a multi-part Content message. A `Part` consists of data which has an associated datatype. A `Part` can only contain one of the accepted types in `Part.data`. For media types that are not text, `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if `inline_data` or `file_data` field is filled with raw bytes.
        &quot;codeExecutionResult&quot;: { # Result of executing the [ExecutableCode]. Only generated when using the [CodeExecution] tool, and always follows a `part` containing the [ExecutableCode]. # Optional. The result of executing the ExecutableCode.
          &quot;outcome&quot;: &quot;A String&quot;, # Required. Outcome of the code execution.
          &quot;output&quot;: &quot;A String&quot;, # Optional. Contains stdout when code execution is successful, stderr or other description otherwise.
        },
        &quot;executableCode&quot;: { # Code generated by the model that is meant to be executed, and the result returned to the model. Generated when using the [CodeExecution] tool, in which the code will be automatically executed, and a corresponding [CodeExecutionResult] will also be generated. # Optional. Code generated by the model that is intended to be executed.
          &quot;code&quot;: &quot;A String&quot;, # Required. The code to be executed.
          &quot;language&quot;: &quot;A String&quot;, # Required. Programming language of the `code`.
        },
        &quot;fileData&quot;: { # URI-based data. A FileData message contains a URI pointing to data of a specific media type. It is used to represent images, audio, and video stored in Google Cloud Storage. # Optional. The URI-based data of the part. This can be used to include files from Google Cloud Storage.
          &quot;displayName&quot;: &quot;A String&quot;, # Optional. The display name of the file. Used to provide a label or filename to distinguish files. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server side tools (`code_execution`, `google_search`, and `url_context`) are enabled.
          &quot;fileUri&quot;: &quot;A String&quot;, # Required. The URI of the file in Google Cloud Storage.
          &quot;mimeType&quot;: &quot;A String&quot;, # Required. The IANA standard MIME type of the source data.
        },
        &quot;functionCall&quot;: { # A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing the parameters and their values. # Optional. A predicted function call returned from the model. This contains the name of the function to call and the arguments to pass to the function.
          &quot;args&quot;: { # Optional. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.
            &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
          },
          &quot;name&quot;: &quot;A String&quot;, # Optional. The name of the function to call. Matches [FunctionDeclaration.name].
        },
        &quot;functionResponse&quot;: { # The result output from a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a [FunctionCall] made based on model prediction. # Optional. The result of a function call. This is used to provide the model with the result of a function call that it predicted.
          &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].
          &quot;parts&quot;: [ # Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types.
            { # A datatype containing media that is part of a `FunctionResponse` message. A `FunctionResponsePart` consists of data which has an associated datatype. A `FunctionResponsePart` can only contain one of the accepted types in `FunctionResponsePart.data`. A `FunctionResponsePart` must have a fixed IANA MIME type identifying the type and subtype of the media if the `inline_data` field is filled with raw bytes.
              &quot;fileData&quot;: { # URI based data for function response. # URI based data.
                &quot;displayName&quot;: &quot;A String&quot;, # Optional. Display name of the file data. Used to provide a label or filename to distinguish file datas. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled.
                &quot;fileUri&quot;: &quot;A String&quot;, # Required. URI.
                &quot;mimeType&quot;: &quot;A String&quot;, # Required. The IANA standard MIME type of the source data.
              },
              &quot;inlineData&quot;: { # Raw media bytes for function response. Text should not be sent as raw bytes, use the &#x27;text&#x27; field. # Inline media bytes.
                &quot;data&quot;: &quot;A String&quot;, # Required. Raw bytes.
                &quot;displayName&quot;: &quot;A String&quot;, # Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled.
                &quot;mimeType&quot;: &quot;A String&quot;, # Required. The IANA standard MIME type of the source data.
              },
            },
          ],
          &quot;response&quot;: { # Required. The function response in JSON object format. Use &quot;output&quot; key to specify function output and &quot;error&quot; key to specify error details (if any). If &quot;output&quot; and &quot;error&quot; keys are not specified, then whole &quot;response&quot; is treated as function output.
            &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
          },
        },
        &quot;inlineData&quot;: { # A content blob. A Blob contains data of a specific media type. It is used to represent images, audio, and video. # Optional. The inline data content of the part. This can be used to include images, audio, or video in a request.
          &quot;data&quot;: &quot;A String&quot;, # Required. The raw bytes of the data.
          &quot;displayName&quot;: &quot;A String&quot;, # Optional. The display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server-side tools (`code_execution`, `google_search`, and `url_context`) are enabled.
          &quot;mimeType&quot;: &quot;A String&quot;, # Required. The IANA standard MIME type of the source data.
        },
        &quot;text&quot;: &quot;A String&quot;, # Optional. The text content of the part.
        &quot;thought&quot;: True or False, # Optional. Indicates whether the `part` represents the model&#x27;s thought process or reasoning.
        &quot;thoughtSignature&quot;: &quot;A String&quot;, # Optional. An opaque signature for the thought so it can be reused in subsequent requests.
        &quot;videoMetadata&quot;: { # Provides metadata for a video, including the start and end offsets for clipping and the frame rate. # Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.
          &quot;endOffset&quot;: &quot;A String&quot;, # Optional. The end offset of the video.
          &quot;fps&quot;: 3.14, # Optional. The frame rate of the video sent to the model. If not specified, the default value is 1.0. The valid range is (0.0, 24.0].
          &quot;startOffset&quot;: &quot;A String&quot;, # Optional. The start offset of the video.
        },
      },
    ],
    &quot;role&quot;: &quot;A String&quot;, # Optional. The producer of the content. Must be either &#x27;user&#x27; or &#x27;model&#x27;. If not set, the service will default to &#x27;user&#x27;.
  },
  &quot;tools&quot;: [ # Optional. A list of `Tools` the model may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model.
    { # Tool details that the model may use to generate response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model. A Tool object should contain exactly one type of Tool (e.g FunctionDeclaration, Retrieval or GoogleSearchRetrieval).
      &quot;codeExecution&quot;: { # Tool that executes code generated by the model, and automatically returns the result to the model. See also [ExecutableCode]and [CodeExecutionResult] which are input and output to this tool. # Optional. CodeExecution tool type. Enables the model to execute code as part of generation.
      },
      &quot;computerUse&quot;: { # Tool to support computer use. # Optional. Tool to support the model interacting directly with the computer. If enabled, it automatically populates computer-use specific Function Declarations.
        &quot;environment&quot;: &quot;A String&quot;, # Required. The environment being operated.
        &quot;excludedPredefinedFunctions&quot;: [ # Optional. By default, [predefined functions](https://cloud.google.com/vertex-ai/generative-ai/docs/computer-use#supported-actions) are included in the final model call. Some of them can be explicitly excluded from being automatically included. This can serve two purposes: 1. Using a more restricted / different action space. 2. Improving the definitions / instructions of predefined functions.
          &quot;A String&quot;,
        ],
      },
      &quot;enterpriseWebSearch&quot;: { # Tool to search public web data, powered by Vertex AI Search and Sec4 compliance. # Optional. Tool to support searching public web data, powered by Vertex AI Search and Sec4 compliance.
        &quot;blockingConfidence&quot;: &quot;A String&quot;, # Optional. Sites with confidence level chosen &amp; above this value will be blocked from the search results.
        &quot;excludeDomains&quot;: [ # Optional. List of domains to be excluded from the search results. The default limit is 2000 domains.
          &quot;A String&quot;,
        ],
      },
      &quot;functionDeclarations&quot;: [ # Optional. Function tool type. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating FunctionCall in the response. User should provide a FunctionResponse for each function call in the next turn. Based on the function responses, Model will generate the final response back to the user. Maximum 512 function declarations can be provided.
        { # Structured representation of a function declaration as defined by the [OpenAPI 3.0 specification](https://spec.openapis.org/oas/v3.0.3). Included in this declaration are the function name, description, parameters and response type. This FunctionDeclaration is a representation of a block of code that can be used as a `Tool` by the model and executed by the client.
          &quot;description&quot;: &quot;A String&quot;, # Optional. Description and purpose of the function. Model uses it to decide how and whether to call the function.
          &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to call. Must start with a letter or an underscore. Must be a-z, A-Z, 0-9, or contain underscores, dots and dashes, with a maximum length of 64.
          &quot;parameters&quot;: { # Schema is used to define the format of input/output data. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may be added in the future as needed. # Optional. Describes the parameters to this function in JSON Schema Object format. Reflects the Open API 3.03 Parameter Object. string Key: the name of the parameter. Parameter names are case sensitive. Schema Value: the Schema defining the type used for the parameter. For function with no parameters, this can be left unset. Parameter names must start with a letter or an underscore and must only contain chars a-z, A-Z, 0-9, or underscores with a maximum length of 64. Example with 1 required and 1 optional parameter: type: OBJECT properties: param1: type: STRING param2: type: INTEGER required: - param1
            &quot;additionalProperties&quot;: &quot;&quot;, # Optional. Can either be a boolean or an object; controls the presence of additional properties.
            &quot;anyOf&quot;: [ # Optional. The value should be validated against any (one or more) of the subschemas in the list.
              # Object with schema name: GoogleCloudAiplatformV1Schema
            ],
            &quot;default&quot;: &quot;&quot;, # Optional. Default value of the data.
            &quot;defs&quot;: { # Optional. A map of definitions for use by `ref` Only allowed at the root of the schema.
              &quot;a_key&quot;: # Object with schema name: GoogleCloudAiplatformV1Schema
            },
            &quot;description&quot;: &quot;A String&quot;, # Optional. The description of the data.
            &quot;enum&quot;: [ # Optional. Possible values of the element of primitive type with enum format. Examples: 1. We can define direction as : {type:STRING, format:enum, enum:[&quot;EAST&quot;, NORTH&quot;, &quot;SOUTH&quot;, &quot;WEST&quot;]} 2. We can define apartment number as : {type:INTEGER, format:enum, enum:[&quot;101&quot;, &quot;201&quot;, &quot;301&quot;]}
              &quot;A String&quot;,
            ],
            &quot;example&quot;: &quot;&quot;, # Optional. Example of the object. Will only populated when the object is the root.
            &quot;format&quot;: &quot;A String&quot;, # Optional. The format of the data. Supported formats: for NUMBER type: &quot;float&quot;, &quot;double&quot; for INTEGER type: &quot;int32&quot;, &quot;int64&quot; for STRING type: &quot;email&quot;, &quot;byte&quot;, etc
            &quot;items&quot;: # Object with schema name: GoogleCloudAiplatformV1Schema # Optional. SCHEMA FIELDS FOR TYPE ARRAY Schema of the elements of Type.ARRAY.
            &quot;maxItems&quot;: &quot;A String&quot;, # Optional. Maximum number of the elements for Type.ARRAY.
            &quot;maxLength&quot;: &quot;A String&quot;, # Optional. Maximum length of the Type.STRING
            &quot;maxProperties&quot;: &quot;A String&quot;, # Optional. Maximum number of the properties for Type.OBJECT.
            &quot;maximum&quot;: 3.14, # Optional. Maximum value of the Type.INTEGER and Type.NUMBER
            &quot;minItems&quot;: &quot;A String&quot;, # Optional. Minimum number of the elements for Type.ARRAY.
            &quot;minLength&quot;: &quot;A String&quot;, # Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING
            &quot;minProperties&quot;: &quot;A String&quot;, # Optional. Minimum number of the properties for Type.OBJECT.
            &quot;minimum&quot;: 3.14, # Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER
            &quot;nullable&quot;: True or False, # Optional. Indicates if the value may be null.
            &quot;pattern&quot;: &quot;A String&quot;, # Optional. Pattern of the Type.STRING to restrict a string to a regular expression.
            &quot;properties&quot;: { # Optional. SCHEMA FIELDS FOR TYPE OBJECT Properties of Type.OBJECT.
              &quot;a_key&quot;: # Object with schema name: GoogleCloudAiplatformV1Schema
            },
            &quot;propertyOrdering&quot;: [ # Optional. The order of the properties. Not a standard field in open api spec. Only used to support the order of the properties.
              &quot;A String&quot;,
            ],
            &quot;ref&quot;: &quot;A String&quot;, # Optional. Allows indirect references between schema nodes. The value should be a valid reference to a child of the root `defs`. For example, the following schema defines a reference to a schema node named &quot;Pet&quot;: type: object properties: pet: ref: #/defs/Pet defs: Pet: type: object properties: name: type: string The value of the &quot;pet&quot; property is a reference to the schema node named &quot;Pet&quot;. See details in https://json-schema.org/understanding-json-schema/structuring
            &quot;required&quot;: [ # Optional. Required properties of Type.OBJECT.
              &quot;A String&quot;,
            ],
            &quot;title&quot;: &quot;A String&quot;, # Optional. The title of the Schema.
            &quot;type&quot;: &quot;A String&quot;, # Optional. The type of the data.
          },
          &quot;parametersJsonSchema&quot;: &quot;&quot;, # Optional. Describes the parameters to the function in JSON Schema format. The schema must describe an object where the properties are the parameters to the function. For example: ``` { &quot;type&quot;: &quot;object&quot;, &quot;properties&quot;: { &quot;name&quot;: { &quot;type&quot;: &quot;string&quot; }, &quot;age&quot;: { &quot;type&quot;: &quot;integer&quot; } }, &quot;additionalProperties&quot;: false, &quot;required&quot;: [&quot;name&quot;, &quot;age&quot;], &quot;propertyOrdering&quot;: [&quot;name&quot;, &quot;age&quot;] } ``` This field is mutually exclusive with `parameters`.
          &quot;response&quot;: { # Schema is used to define the format of input/output data. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may be added in the future as needed. # Optional. Describes the output from this function in JSON Schema format. Reflects the Open API 3.03 Response Object. The Schema defines the type used for the response value of the function.
            &quot;additionalProperties&quot;: &quot;&quot;, # Optional. Can either be a boolean or an object; controls the presence of additional properties.
            &quot;anyOf&quot;: [ # Optional. The value should be validated against any (one or more) of the subschemas in the list.
              # Object with schema name: GoogleCloudAiplatformV1Schema
            ],
            &quot;default&quot;: &quot;&quot;, # Optional. Default value of the data.
            &quot;defs&quot;: { # Optional. A map of definitions for use by `ref` Only allowed at the root of the schema.
              &quot;a_key&quot;: # Object with schema name: GoogleCloudAiplatformV1Schema
            },
            &quot;description&quot;: &quot;A String&quot;, # Optional. The description of the data.
            &quot;enum&quot;: [ # Optional. Possible values of the element of primitive type with enum format. Examples: 1. We can define direction as : {type:STRING, format:enum, enum:[&quot;EAST&quot;, NORTH&quot;, &quot;SOUTH&quot;, &quot;WEST&quot;]} 2. We can define apartment number as : {type:INTEGER, format:enum, enum:[&quot;101&quot;, &quot;201&quot;, &quot;301&quot;]}
              &quot;A String&quot;,
            ],
            &quot;example&quot;: &quot;&quot;, # Optional. Example of the object. Will only populated when the object is the root.
            &quot;format&quot;: &quot;A String&quot;, # Optional. The format of the data. Supported formats: for NUMBER type: &quot;float&quot;, &quot;double&quot; for INTEGER type: &quot;int32&quot;, &quot;int64&quot; for STRING type: &quot;email&quot;, &quot;byte&quot;, etc
            &quot;items&quot;: # Object with schema name: GoogleCloudAiplatformV1Schema # Optional. SCHEMA FIELDS FOR TYPE ARRAY Schema of the elements of Type.ARRAY.
            &quot;maxItems&quot;: &quot;A String&quot;, # Optional. Maximum number of the elements for Type.ARRAY.
            &quot;maxLength&quot;: &quot;A String&quot;, # Optional. Maximum length of the Type.STRING
            &quot;maxProperties&quot;: &quot;A String&quot;, # Optional. Maximum number of the properties for Type.OBJECT.
            &quot;maximum&quot;: 3.14, # Optional. Maximum value of the Type.INTEGER and Type.NUMBER
            &quot;minItems&quot;: &quot;A String&quot;, # Optional. Minimum number of the elements for Type.ARRAY.
            &quot;minLength&quot;: &quot;A String&quot;, # Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING
            &quot;minProperties&quot;: &quot;A String&quot;, # Optional. Minimum number of the properties for Type.OBJECT.
            &quot;minimum&quot;: 3.14, # Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER
            &quot;nullable&quot;: True or False, # Optional. Indicates if the value may be null.
            &quot;pattern&quot;: &quot;A String&quot;, # Optional. Pattern of the Type.STRING to restrict a string to a regular expression.
            &quot;properties&quot;: { # Optional. SCHEMA FIELDS FOR TYPE OBJECT Properties of Type.OBJECT.
              &quot;a_key&quot;: # Object with schema name: GoogleCloudAiplatformV1Schema
            },
            &quot;propertyOrdering&quot;: [ # Optional. The order of the properties. Not a standard field in open api spec. Only used to support the order of the properties.
              &quot;A String&quot;,
            ],
            &quot;ref&quot;: &quot;A String&quot;, # Optional. Allows indirect references between schema nodes. The value should be a valid reference to a child of the root `defs`. For example, the following schema defines a reference to a schema node named &quot;Pet&quot;: type: object properties: pet: ref: #/defs/Pet defs: Pet: type: object properties: name: type: string The value of the &quot;pet&quot; property is a reference to the schema node named &quot;Pet&quot;. See details in https://json-schema.org/understanding-json-schema/structuring
            &quot;required&quot;: [ # Optional. Required properties of Type.OBJECT.
              &quot;A String&quot;,
            ],
            &quot;title&quot;: &quot;A String&quot;, # Optional. The title of the Schema.
            &quot;type&quot;: &quot;A String&quot;, # Optional. The type of the data.
          },
          &quot;responseJsonSchema&quot;: &quot;&quot;, # Optional. Describes the output from this function in JSON Schema format. The value specified by the schema is the response value of the function. This field is mutually exclusive with `response`.
        },
      ],
      &quot;googleMaps&quot;: { # Tool to retrieve public maps data for grounding, powered by Google. # Optional. GoogleMaps tool type. Tool to support Google Maps in Model.
        &quot;enableWidget&quot;: True or False, # Optional. If true, include the widget context token in the response.
      },
      &quot;googleSearch&quot;: { # GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google. # Optional. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google.
        &quot;blockingConfidence&quot;: &quot;A String&quot;, # Optional. Sites with confidence level chosen &amp; above this value will be blocked from the search results.
        &quot;excludeDomains&quot;: [ # Optional. List of domains to be excluded from the search results. The default limit is 2000 domains. Example: [&quot;amazon.com&quot;, &quot;facebook.com&quot;].
          &quot;A String&quot;,
        ],
      },
      &quot;googleSearchRetrieval&quot;: { # Tool to retrieve public web data for grounding, powered by Google. # Optional. Specialized retrieval tool that is powered by Google Search.
        &quot;dynamicRetrievalConfig&quot;: { # Describes the options to customize dynamic retrieval. # Specifies the dynamic retrieval configuration for the given source.
          &quot;dynamicThreshold&quot;: 3.14, # Optional. The threshold to be used in dynamic retrieval. If not set, a system default value is used.
          &quot;mode&quot;: &quot;A String&quot;, # The mode of the predictor to be used in dynamic retrieval.
        },
      },
      &quot;retrieval&quot;: { # Defines a retrieval tool that model can call to access external knowledge. # Optional. Retrieval tool type. System will always execute the provided retrieval tool(s) to get external knowledge to answer the prompt. Retrieval results are presented to the model for generation.
        &quot;disableAttribution&quot;: True or False, # Optional. Deprecated. This option is no longer supported.
        &quot;externalApi&quot;: { # Retrieve from data source powered by external API for grounding. The external API is not owned by Google, but need to follow the pre-defined API spec. # Use data source powered by external API for grounding.
          &quot;apiAuth&quot;: { # The generic reusable api auth config. Deprecated. Please use AuthConfig (google/cloud/aiplatform/master/auth.proto) instead. # The authentication config to access the API. Deprecated. Please use auth_config instead.
            &quot;apiKeyConfig&quot;: { # The API secret. # The API secret.
              &quot;apiKeySecretVersion&quot;: &quot;A String&quot;, # Required. The SecretManager secret version resource name storing API key. e.g. projects/{project}/secrets/{secret}/versions/{version}
              &quot;apiKeyString&quot;: &quot;A String&quot;, # The API key string. Either this or `api_key_secret_version` must be set.
            },
          },
          &quot;apiSpec&quot;: &quot;A String&quot;, # The API spec that the external API implements.
          &quot;authConfig&quot;: { # Auth configuration to run the extension. # The authentication config to access the API.
            &quot;apiKeyConfig&quot;: { # Config for authentication with API key. # Config for API key auth.
              &quot;apiKeySecret&quot;: &quot;A String&quot;, # Optional. The name of the SecretManager secret version resource storing the API key. Format: `projects/{project}/secrets/{secrete}/versions/{version}` - If both `api_key_secret` and `api_key_string` are specified, this field takes precedence over `api_key_string`. - If specified, the `secretmanager.versions.access` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified resource.
              &quot;apiKeyString&quot;: &quot;A String&quot;, # Optional. The API key to be used in the request directly.
              &quot;httpElementLocation&quot;: &quot;A String&quot;, # Optional. The location of the API key.
              &quot;name&quot;: &quot;A String&quot;, # Optional. The parameter name of the API key. E.g. If the API request is &quot;https://example.com/act?api_key=&quot;, &quot;api_key&quot; would be the parameter name.
            },
            &quot;authType&quot;: &quot;A String&quot;, # Type of auth scheme.
            &quot;googleServiceAccountConfig&quot;: { # Config for Google Service Account Authentication. # Config for Google Service Account auth.
              &quot;serviceAccount&quot;: &quot;A String&quot;, # Optional. The service account that the extension execution service runs as. - If the service account is specified, the `iam.serviceAccounts.getAccessToken` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified service account. - If not specified, the Vertex AI Extension Service Agent will be used to execute the Extension.
            },
            &quot;httpBasicAuthConfig&quot;: { # Config for HTTP Basic Authentication. # Config for HTTP Basic auth.
              &quot;credentialSecret&quot;: &quot;A String&quot;, # Required. The name of the SecretManager secret version resource storing the base64 encoded credentials. Format: `projects/{project}/secrets/{secrete}/versions/{version}` - If specified, the `secretmanager.versions.access` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified resource.
            },
            &quot;oauthConfig&quot;: { # Config for user oauth. # Config for user oauth.
              &quot;accessToken&quot;: &quot;A String&quot;, # Access token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time.
              &quot;serviceAccount&quot;: &quot;A String&quot;, # The service account used to generate access tokens for executing the Extension. - If the service account is specified, the `iam.serviceAccounts.getAccessToken` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the provided service account.
            },
            &quot;oidcConfig&quot;: { # Config for user OIDC auth. # Config for user OIDC auth.
              &quot;idToken&quot;: &quot;A String&quot;, # OpenID Connect formatted ID token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time.
              &quot;serviceAccount&quot;: &quot;A String&quot;, # The service account used to generate an OpenID Connect (OIDC)-compatible JWT token signed by the Google OIDC Provider (accounts.google.com) for extension endpoint (https://cloud.google.com/iam/docs/create-short-lived-credentials-direct#sa-credentials-oidc). - The audience for the token will be set to the URL in the server url defined in the OpenApi spec. - If the service account is provided, the service account should grant `iam.serviceAccounts.getOpenIdToken` permission to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents).
            },
          },
          &quot;elasticSearchParams&quot;: { # The search parameters to use for the ELASTIC_SEARCH spec. # Parameters for the elastic search API.
            &quot;index&quot;: &quot;A String&quot;, # The ElasticSearch index to use.
            &quot;numHits&quot;: 42, # Optional. Number of hits (chunks) to request. When specified, it is passed to Elasticsearch as the `num_hits` param.
            &quot;searchTemplate&quot;: &quot;A String&quot;, # The ElasticSearch search template to use.
          },
          &quot;endpoint&quot;: &quot;A String&quot;, # The endpoint of the external API. The system will call the API at this endpoint to retrieve the data for grounding. Example: https://acme.com:443/search
          &quot;simpleSearchParams&quot;: { # The search parameters to use for SIMPLE_SEARCH spec. # Parameters for the simple search API.
          },
        },
        &quot;vertexAiSearch&quot;: { # Retrieve from Vertex AI Search datastore or engine for grounding. datastore and engine are mutually exclusive. See https://cloud.google.com/products/agent-builder # Set to use data source powered by Vertex AI Search.
          &quot;dataStoreSpecs&quot;: [ # Specifications that define the specific DataStores to be searched, along with configurations for those data stores. This is only considered for Engines with multiple data stores. It should only be set if engine is used.
            { # Define data stores within engine to filter on in a search call and configurations for those data stores. For more information, see https://cloud.google.com/generative-ai-app-builder/docs/reference/rpc/google.cloud.discoveryengine.v1#datastorespec
              &quot;dataStore&quot;: &quot;A String&quot;, # Full resource name of DataStore, such as Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}`
              &quot;filter&quot;: &quot;A String&quot;, # Optional. Filter specification to filter documents in the data store specified by data_store field. For more information on filtering, see [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
            },
          ],
          &quot;datastore&quot;: &quot;A String&quot;, # Optional. Fully-qualified Vertex AI Search data store resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}`
          &quot;engine&quot;: &quot;A String&quot;, # Optional. Fully-qualified Vertex AI Search engine resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}`
          &quot;filter&quot;: &quot;A String&quot;, # Optional. Filter strings to be passed to the search API.
          &quot;maxResults&quot;: 42, # Optional. Number of search results to return per query. The default value is 10. The maximumm allowed value is 10.
        },
        &quot;vertexRagStore&quot;: { # Retrieve from Vertex RAG Store for grounding. # Set to use data source powered by Vertex RAG store. User data is uploaded via the VertexRagDataService.
          &quot;ragResources&quot;: [ # Optional. The representation of the rag source. It can be used to specify corpus only or ragfiles. Currently only support one corpus or multiple files from one corpus. In the future we may open up multiple corpora support.
            { # The definition of the Rag resource.
              &quot;ragCorpus&quot;: &quot;A String&quot;, # Optional. RagCorpora resource name. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`
              &quot;ragFileIds&quot;: [ # Optional. rag_file_id. The files should be in the same rag_corpus set in rag_corpus field.
                &quot;A String&quot;,
              ],
            },
          ],
          &quot;ragRetrievalConfig&quot;: { # Specifies the context retrieval config. # Optional. The retrieval config for the Rag query.
            &quot;filter&quot;: { # Config for filters. # Optional. Config for filters.
              &quot;metadataFilter&quot;: &quot;A String&quot;, # Optional. String for metadata filtering.
              &quot;vectorDistanceThreshold&quot;: 3.14, # Optional. Only returns contexts with vector distance smaller than the threshold.
              &quot;vectorSimilarityThreshold&quot;: 3.14, # Optional. Only returns contexts with vector similarity larger than the threshold.
            },
            &quot;ranking&quot;: { # Config for ranking and reranking. # Optional. Config for ranking and reranking.
              &quot;llmRanker&quot;: { # Config for LlmRanker. # Optional. Config for LlmRanker.
                &quot;modelName&quot;: &quot;A String&quot;, # Optional. The model name used for ranking. See [Supported models](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/inference#supported-models).
              },
              &quot;rankService&quot;: { # Config for Rank Service. # Optional. Config for Rank Service.
                &quot;modelName&quot;: &quot;A String&quot;, # Optional. The model name of the rank service. Format: `semantic-ranker-512@latest`
              },
            },
            &quot;topK&quot;: 42, # Optional. The number of contexts to retrieve.
          },
          &quot;similarityTopK&quot;: 42, # Optional. Number of top k results to return from the selected corpora.
          &quot;vectorDistanceThreshold&quot;: 3.14, # Optional. Only return results with vector distance smaller than the threshold.
        },
      },
      &quot;urlContext&quot;: { # Tool to support URL context. # Optional. Tool to support URL context retrieval.
      },
    },
  ],
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Response message for PredictionService.CountTokens.
  &quot;promptTokensDetails&quot;: [ # Output only. List of modalities that were processed in the request input.
    { # Represents a breakdown of token usage by modality. This message is used in CountTokensResponse and GenerateContentResponse.UsageMetadata to provide a detailed view of how many tokens are used by each modality (e.g., text, image, video) in a request. This is particularly useful for multimodal models, allowing you to track and manage token consumption for billing and quota purposes.
      &quot;modality&quot;: &quot;A String&quot;, # The modality that this token count applies to.
      &quot;tokenCount&quot;: 42, # The number of tokens counted for this modality.
    },
  ],
  &quot;totalBillableCharacters&quot;: 42, # The total number of billable characters counted across all instances from the request.
  &quot;totalTokens&quot;: 42, # The total number of tokens counted across all instances from the request.
}</pre>
</div>

<div class="method">
    <code class="details" id="fetchPredictOperation">fetchPredictOperation(endpoint, body=None, x__xgafv=None)</code>
  <pre>Fetch an asynchronous online prediction operation.

Args:
  endpoint: string, Required. The name of the Endpoint requested to serve the prediction. Format: `projects/{project}/locations/{location}/endpoints/{endpoint}` or `projects/{project}/locations/{location}/publishers/{publisher}/models/{model}` (required)
  body: object, The request body.
    The object takes the form of:

{ # Request message for PredictionService.FetchPredictOperation.
  &quot;operationName&quot;: &quot;A String&quot;, # Required. The server-assigned name for the operation.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # This resource represents a long-running operation that is the result of a network API call.
  &quot;done&quot;: True or False, # If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.
  &quot;error&quot;: { # The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). # The error result of the operation in case of failure or cancellation.
    &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
    &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
      {
        &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
      },
    ],
    &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
  },
  &quot;metadata&quot;: { # Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.
    &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
  },
  &quot;name&quot;: &quot;A String&quot;, # The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.
  &quot;response&quot;: { # The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
    &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
  },
}</pre>
</div>

<div class="method">
    <code class="details" id="generateContent">generateContent(model, body=None, x__xgafv=None)</code>
  <pre>Generate content with multimodal inputs.

Args:
  model: string, Required. The fully qualified name of the publisher model or tuned model endpoint to use. Publisher model format: `projects/{project}/locations/{location}/publishers/*/models/*` Tuned model endpoint format: `projects/{project}/locations/{location}/endpoints/{endpoint}` (required)
  body: object, The request body.
    The object takes the form of:

{ # Request message for [PredictionService.GenerateContent].
  &quot;cachedContent&quot;: &quot;A String&quot;, # Optional. The name of the cached content used as context to serve the prediction. Note: only used in explicit caching, where users can have control over caching (e.g. what content to cache) and enjoy guaranteed cost savings. Format: `projects/{project}/locations/{location}/cachedContents/{cachedContent}`
  &quot;contents&quot;: [ # Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries, this is a repeated field that contains conversation history + latest request.
    { # The structured data content of a message. A Content message contains a `role` field, which indicates the producer of the content, and a `parts` field, which contains the multi-part data of the message.
      &quot;parts&quot;: [ # Required. A list of Part objects that make up a single message. Parts of a message can have different MIME types. A Content message must have at least one Part.
        { # A datatype containing media that is part of a multi-part Content message. A `Part` consists of data which has an associated datatype. A `Part` can only contain one of the accepted types in `Part.data`. For media types that are not text, `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if `inline_data` or `file_data` field is filled with raw bytes.
          &quot;codeExecutionResult&quot;: { # Result of executing the [ExecutableCode]. Only generated when using the [CodeExecution] tool, and always follows a `part` containing the [ExecutableCode]. # Optional. The result of executing the ExecutableCode.
            &quot;outcome&quot;: &quot;A String&quot;, # Required. Outcome of the code execution.
            &quot;output&quot;: &quot;A String&quot;, # Optional. Contains stdout when code execution is successful, stderr or other description otherwise.
          },
          &quot;executableCode&quot;: { # Code generated by the model that is meant to be executed, and the result returned to the model. Generated when using the [CodeExecution] tool, in which the code will be automatically executed, and a corresponding [CodeExecutionResult] will also be generated. # Optional. Code generated by the model that is intended to be executed.
            &quot;code&quot;: &quot;A String&quot;, # Required. The code to be executed.
            &quot;language&quot;: &quot;A String&quot;, # Required. Programming language of the `code`.
          },
          &quot;fileData&quot;: { # URI-based data. A FileData message contains a URI pointing to data of a specific media type. It is used to represent images, audio, and video stored in Google Cloud Storage. # Optional. The URI-based data of the part. This can be used to include files from Google Cloud Storage.
            &quot;displayName&quot;: &quot;A String&quot;, # Optional. The display name of the file. Used to provide a label or filename to distinguish files. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server side tools (`code_execution`, `google_search`, and `url_context`) are enabled.
            &quot;fileUri&quot;: &quot;A String&quot;, # Required. The URI of the file in Google Cloud Storage.
            &quot;mimeType&quot;: &quot;A String&quot;, # Required. The IANA standard MIME type of the source data.
          },
          &quot;functionCall&quot;: { # A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing the parameters and their values. # Optional. A predicted function call returned from the model. This contains the name of the function to call and the arguments to pass to the function.
            &quot;args&quot;: { # Optional. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.
              &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
            },
            &quot;name&quot;: &quot;A String&quot;, # Optional. The name of the function to call. Matches [FunctionDeclaration.name].
          },
          &quot;functionResponse&quot;: { # The result output from a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a [FunctionCall] made based on model prediction. # Optional. The result of a function call. This is used to provide the model with the result of a function call that it predicted.
            &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].
            &quot;parts&quot;: [ # Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types.
              { # A datatype containing media that is part of a `FunctionResponse` message. A `FunctionResponsePart` consists of data which has an associated datatype. A `FunctionResponsePart` can only contain one of the accepted types in `FunctionResponsePart.data`. A `FunctionResponsePart` must have a fixed IANA MIME type identifying the type and subtype of the media if the `inline_data` field is filled with raw bytes.
                &quot;fileData&quot;: { # URI based data for function response. # URI based data.
                  &quot;displayName&quot;: &quot;A String&quot;, # Optional. Display name of the file data. Used to provide a label or filename to distinguish file datas. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled.
                  &quot;fileUri&quot;: &quot;A String&quot;, # Required. URI.
                  &quot;mimeType&quot;: &quot;A String&quot;, # Required. The IANA standard MIME type of the source data.
                },
                &quot;inlineData&quot;: { # Raw media bytes for function response. Text should not be sent as raw bytes, use the &#x27;text&#x27; field. # Inline media bytes.
                  &quot;data&quot;: &quot;A String&quot;, # Required. Raw bytes.
                  &quot;displayName&quot;: &quot;A String&quot;, # Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled.
                  &quot;mimeType&quot;: &quot;A String&quot;, # Required. The IANA standard MIME type of the source data.
                },
              },
            ],
            &quot;response&quot;: { # Required. The function response in JSON object format. Use &quot;output&quot; key to specify function output and &quot;error&quot; key to specify error details (if any). If &quot;output&quot; and &quot;error&quot; keys are not specified, then whole &quot;response&quot; is treated as function output.
              &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
            },
          },
          &quot;inlineData&quot;: { # A content blob. A Blob contains data of a specific media type. It is used to represent images, audio, and video. # Optional. The inline data content of the part. This can be used to include images, audio, or video in a request.
            &quot;data&quot;: &quot;A String&quot;, # Required. The raw bytes of the data.
            &quot;displayName&quot;: &quot;A String&quot;, # Optional. The display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server-side tools (`code_execution`, `google_search`, and `url_context`) are enabled.
            &quot;mimeType&quot;: &quot;A String&quot;, # Required. The IANA standard MIME type of the source data.
          },
          &quot;text&quot;: &quot;A String&quot;, # Optional. The text content of the part.
          &quot;thought&quot;: True or False, # Optional. Indicates whether the `part` represents the model&#x27;s thought process or reasoning.
          &quot;thoughtSignature&quot;: &quot;A String&quot;, # Optional. An opaque signature for the thought so it can be reused in subsequent requests.
          &quot;videoMetadata&quot;: { # Provides metadata for a video, including the start and end offsets for clipping and the frame rate. # Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.
            &quot;endOffset&quot;: &quot;A String&quot;, # Optional. The end offset of the video.
            &quot;fps&quot;: 3.14, # Optional. The frame rate of the video sent to the model. If not specified, the default value is 1.0. The valid range is (0.0, 24.0].
            &quot;startOffset&quot;: &quot;A String&quot;, # Optional. The start offset of the video.
          },
        },
      ],
      &quot;role&quot;: &quot;A String&quot;, # Optional. The producer of the content. Must be either &#x27;user&#x27; or &#x27;model&#x27;. If not set, the service will default to &#x27;user&#x27;.
    },
  ],
  &quot;generationConfig&quot;: { # Configuration for content generation. This message contains all the parameters that control how the model generates content. It allows you to influence the randomness, length, and structure of the output. # Optional. Generation config.
    &quot;audioTimestamp&quot;: True or False, # Optional. If enabled, audio timestamps will be included in the request to the model. This can be useful for synchronizing audio with other modalities in the response.
    &quot;candidateCount&quot;: 42, # Optional. The number of candidate responses to generate. A higher `candidate_count` can provide more options to choose from, but it also consumes more resources. This can be useful for generating a variety of responses and selecting the best one.
    &quot;enableAffectiveDialog&quot;: True or False, # Optional. If enabled, the model will detect emotions and adapt its responses accordingly. For example, if the model detects that the user is frustrated, it may provide a more empathetic response.
    &quot;frequencyPenalty&quot;: 3.14, # Optional. Penalizes tokens based on their frequency in the generated text. A positive value helps to reduce the repetition of words and phrases. Valid values can range from [-2.0, 2.0].
    &quot;imageConfig&quot;: { # Configuration for image generation. This message allows you to control various aspects of image generation, such as the output format, aspect ratio, and whether the model can generate images of people. # Optional. Config for image generation features.
      &quot;aspectRatio&quot;: &quot;A String&quot;, # Optional. The desired aspect ratio for the generated images. The following aspect ratios are supported: &quot;1:1&quot; &quot;2:3&quot;, &quot;3:2&quot; &quot;3:4&quot;, &quot;4:3&quot; &quot;4:5&quot;, &quot;5:4&quot; &quot;9:16&quot;, &quot;16:9&quot; &quot;21:9&quot;
      &quot;imageOutputOptions&quot;: { # The image output format for generated images. # Optional. The image output format for generated images.
        &quot;compressionQuality&quot;: 42, # Optional. The compression quality of the output image.
        &quot;mimeType&quot;: &quot;A String&quot;, # Optional. The image format that the output should be saved as.
      },
      &quot;personGeneration&quot;: &quot;A String&quot;, # Optional. Controls whether the model can generate people.
    },
    &quot;logprobs&quot;: 42, # Optional. The number of top log probabilities to return for each token. This can be used to see which other tokens were considered likely candidates for a given position. A higher value will return more options, but it will also increase the size of the response.
    &quot;maxOutputTokens&quot;: 42, # Optional. The maximum number of tokens to generate in the response. A token is approximately four characters. The default value varies by model. This parameter can be used to control the length of the generated text and prevent overly long responses.
    &quot;mediaResolution&quot;: &quot;A String&quot;, # Optional. The token resolution at which input media content is sampled. This is used to control the trade-off between the quality of the response and the number of tokens used to represent the media. A higher resolution allows the model to perceive more detail, which can lead to a more nuanced response, but it will also use more tokens. This does not affect the image dimensions sent to the model.
    &quot;presencePenalty&quot;: 3.14, # Optional. Penalizes tokens that have already appeared in the generated text. A positive value encourages the model to generate more diverse and less repetitive text. Valid values can range from [-2.0, 2.0].
    &quot;responseJsonSchema&quot;: &quot;&quot;, # Optional. When this field is set, response_schema must be omitted and response_mime_type must be set to `application/json`.
    &quot;responseLogprobs&quot;: True or False, # Optional. If set to true, the log probabilities of the output tokens are returned. Log probabilities are the logarithm of the probability of a token appearing in the output. A higher log probability means the token is more likely to be generated. This can be useful for analyzing the model&#x27;s confidence in its own output and for debugging.
    &quot;responseMimeType&quot;: &quot;A String&quot;, # Optional. The IANA standard MIME type of the response. The model will generate output that conforms to this MIME type. Supported values include &#x27;text/plain&#x27; (default) and &#x27;application/json&#x27;. The model needs to be prompted to output the appropriate response type, otherwise the behavior is undefined. This is a preview feature.
    &quot;responseModalities&quot;: [ # Optional. The modalities of the response. The model will generate a response that includes all the specified modalities. For example, if this is set to `[TEXT, IMAGE]`, the response will include both text and an image.
      &quot;A String&quot;,
    ],
    &quot;responseSchema&quot;: { # Schema is used to define the format of input/output data. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may be added in the future as needed. # Optional. Lets you to specify a schema for the model&#x27;s response, ensuring that the output conforms to a particular structure. This is useful for generating structured data such as JSON. The schema is a subset of the [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema) object. When this field is set, you must also set the `response_mime_type` to `application/json`.
      &quot;additionalProperties&quot;: &quot;&quot;, # Optional. Can either be a boolean or an object; controls the presence of additional properties.
      &quot;anyOf&quot;: [ # Optional. The value should be validated against any (one or more) of the subschemas in the list.
        # Object with schema name: GoogleCloudAiplatformV1Schema
      ],
      &quot;default&quot;: &quot;&quot;, # Optional. Default value of the data.
      &quot;defs&quot;: { # Optional. A map of definitions for use by `ref` Only allowed at the root of the schema.
        &quot;a_key&quot;: # Object with schema name: GoogleCloudAiplatformV1Schema
      },
      &quot;description&quot;: &quot;A String&quot;, # Optional. The description of the data.
      &quot;enum&quot;: [ # Optional. Possible values of the element of primitive type with enum format. Examples: 1. We can define direction as : {type:STRING, format:enum, enum:[&quot;EAST&quot;, NORTH&quot;, &quot;SOUTH&quot;, &quot;WEST&quot;]} 2. We can define apartment number as : {type:INTEGER, format:enum, enum:[&quot;101&quot;, &quot;201&quot;, &quot;301&quot;]}
        &quot;A String&quot;,
      ],
      &quot;example&quot;: &quot;&quot;, # Optional. Example of the object. Will only populated when the object is the root.
      &quot;format&quot;: &quot;A String&quot;, # Optional. The format of the data. Supported formats: for NUMBER type: &quot;float&quot;, &quot;double&quot; for INTEGER type: &quot;int32&quot;, &quot;int64&quot; for STRING type: &quot;email&quot;, &quot;byte&quot;, etc
      &quot;items&quot;: # Object with schema name: GoogleCloudAiplatformV1Schema # Optional. SCHEMA FIELDS FOR TYPE ARRAY Schema of the elements of Type.ARRAY.
      &quot;maxItems&quot;: &quot;A String&quot;, # Optional. Maximum number of the elements for Type.ARRAY.
      &quot;maxLength&quot;: &quot;A String&quot;, # Optional. Maximum length of the Type.STRING
      &quot;maxProperties&quot;: &quot;A String&quot;, # Optional. Maximum number of the properties for Type.OBJECT.
      &quot;maximum&quot;: 3.14, # Optional. Maximum value of the Type.INTEGER and Type.NUMBER
      &quot;minItems&quot;: &quot;A String&quot;, # Optional. Minimum number of the elements for Type.ARRAY.
      &quot;minLength&quot;: &quot;A String&quot;, # Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING
      &quot;minProperties&quot;: &quot;A String&quot;, # Optional. Minimum number of the properties for Type.OBJECT.
      &quot;minimum&quot;: 3.14, # Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER
      &quot;nullable&quot;: True or False, # Optional. Indicates if the value may be null.
      &quot;pattern&quot;: &quot;A String&quot;, # Optional. Pattern of the Type.STRING to restrict a string to a regular expression.
      &quot;properties&quot;: { # Optional. SCHEMA FIELDS FOR TYPE OBJECT Properties of Type.OBJECT.
        &quot;a_key&quot;: # Object with schema name: GoogleCloudAiplatformV1Schema
      },
      &quot;propertyOrdering&quot;: [ # Optional. The order of the properties. Not a standard field in open api spec. Only used to support the order of the properties.
        &quot;A String&quot;,
      ],
      &quot;ref&quot;: &quot;A String&quot;, # Optional. Allows indirect references between schema nodes. The value should be a valid reference to a child of the root `defs`. For example, the following schema defines a reference to a schema node named &quot;Pet&quot;: type: object properties: pet: ref: #/defs/Pet defs: Pet: type: object properties: name: type: string The value of the &quot;pet&quot; property is a reference to the schema node named &quot;Pet&quot;. See details in https://json-schema.org/understanding-json-schema/structuring
      &quot;required&quot;: [ # Optional. Required properties of Type.OBJECT.
        &quot;A String&quot;,
      ],
      &quot;title&quot;: &quot;A String&quot;, # Optional. The title of the Schema.
      &quot;type&quot;: &quot;A String&quot;, # Optional. The type of the data.
    },
    &quot;routingConfig&quot;: { # The configuration for routing the request to a specific model. This can be used to control which model is used for the generation, either automatically or by specifying a model name. # Optional. Routing configuration.
      &quot;autoMode&quot;: { # The configuration for automated routing. When automated routing is specified, the routing will be determined by the pretrained routing model and customer provided model routing preference. # In this mode, the model is selected automatically based on the content of the request.
        &quot;modelRoutingPreference&quot;: &quot;A String&quot;, # The model routing preference.
      },
      &quot;manualMode&quot;: { # The configuration for manual routing. When manual routing is specified, the model will be selected based on the model name provided. # In this mode, the model is specified manually.
        &quot;modelName&quot;: &quot;A String&quot;, # The name of the model to use. Only public LLM models are accepted.
      },
    },
    &quot;seed&quot;: 42, # Optional. A seed for the random number generator. By setting a seed, you can make the model&#x27;s output mostly deterministic. For a given prompt and parameters (like temperature, top_p, etc.), the model will produce the same response every time. However, it&#x27;s not a guaranteed absolute deterministic behavior. This is different from parameters like `temperature`, which control the *level* of randomness. `seed` ensures that the &quot;random&quot; choices the model makes are the same on every run, making it essential for testing and ensuring reproducible results.
    &quot;speechConfig&quot;: { # Configuration for speech generation. # Optional. The speech generation config.
      &quot;languageCode&quot;: &quot;A String&quot;, # Optional. The language code (ISO 639-1) for the speech synthesis.
      &quot;multiSpeakerVoiceConfig&quot;: { # Configuration for a multi-speaker text-to-speech request. # The configuration for a multi-speaker text-to-speech request. This field is mutually exclusive with `voice_config`.
        &quot;speakerVoiceConfigs&quot;: [ # Required. A list of configurations for the voices of the speakers. Exactly two speaker voice configurations must be provided.
          { # Configuration for a single speaker in a multi-speaker setup.
            &quot;speaker&quot;: &quot;A String&quot;, # Required. The name of the speaker. This should be the same as the speaker name used in the prompt.
            &quot;voiceConfig&quot;: { # Configuration for a voice. # Required. The configuration for the voice of this speaker.
              &quot;prebuiltVoiceConfig&quot;: { # Configuration for a prebuilt voice. # The configuration for a prebuilt voice.
                &quot;voiceName&quot;: &quot;A String&quot;, # The name of the prebuilt voice to use.
              },
            },
          },
        ],
      },
      &quot;voiceConfig&quot;: { # Configuration for a voice. # The configuration for the voice to use.
        &quot;prebuiltVoiceConfig&quot;: { # Configuration for a prebuilt voice. # The configuration for a prebuilt voice.
          &quot;voiceName&quot;: &quot;A String&quot;, # The name of the prebuilt voice to use.
        },
      },
    },
    &quot;stopSequences&quot;: [ # Optional. A list of character sequences that will stop the model from generating further tokens. If a stop sequence is generated, the output will end at that point. This is useful for controlling the length and structure of the output. For example, you can use [&quot;\n&quot;, &quot;###&quot;] to stop generation at a new line or a specific marker.
      &quot;A String&quot;,
    ],
    &quot;temperature&quot;: 3.14, # Optional. Controls the randomness of the output. A higher temperature results in more creative and diverse responses, while a lower temperature makes the output more predictable and focused. The valid range is (0.0, 2.0].
    &quot;thinkingConfig&quot;: { # Configuration for the model&#x27;s thinking features. &quot;Thinking&quot; is a process where the model breaks down a complex task into smaller, manageable steps. This allows the model to reason about the task, plan its approach, and execute the plan to generate a high-quality response. # Optional. Configuration for thinking features. An error will be returned if this field is set for models that don&#x27;t support thinking.
      &quot;includeThoughts&quot;: True or False, # Optional. If true, the model will include its thoughts in the response. &quot;Thoughts&quot; are the intermediate steps the model takes to arrive at the final response. They can provide insights into the model&#x27;s reasoning process and help with debugging. If this is true, thoughts are returned only when available.
      &quot;thinkingBudget&quot;: 42, # Optional. The token budget for the model&#x27;s thinking process. The model will make a best effort to stay within this budget. This can be used to control the trade-off between response quality and latency.
    },
    &quot;topK&quot;: 3.14, # Optional. Specifies the top-k sampling threshold. The model considers only the top k most probable tokens for the next token. This can be useful for generating more coherent and less random text. For example, a `top_k` of 40 means the model will choose the next word from the 40 most likely words.
    &quot;topP&quot;: 3.14, # Optional. Specifies the nucleus sampling threshold. The model considers only the smallest set of tokens whose cumulative probability is at least `top_p`. This helps generate more diverse and less repetitive responses. For example, a `top_p` of 0.9 means the model considers tokens until the cumulative probability of the tokens to select from reaches 0.9. It&#x27;s recommended to adjust either temperature or `top_p`, but not both.
  },
  &quot;labels&quot;: { # Optional. The labels with user-defined metadata for the request. It is used for billing and reporting only. Label keys and values can be no longer than 63 characters (Unicode codepoints) and can only contain lowercase letters, numeric characters, underscores, and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter.
    &quot;a_key&quot;: &quot;A String&quot;,
  },
  &quot;modelArmorConfig&quot;: { # Configuration for Model Armor. Model Armor is a Google Cloud service that provides safety and security filtering for prompts and responses. It helps protect your AI applications from risks such as harmful content, sensitive data leakage, and prompt injection attacks. # Optional. Settings for prompt and response sanitization using the Model Armor service. If supplied, safety_settings must not be supplied.
    &quot;promptTemplateName&quot;: &quot;A String&quot;, # Optional. The resource name of the Model Armor template to use for prompt screening. A Model Armor template is a set of customized filters and thresholds that define how Model Armor screens content. If specified, Model Armor will use this template to check the user&#x27;s prompt for safety and security risks before it is sent to the model. The name must be in the format `projects/{project}/locations/{location}/templates/{template}`.
    &quot;responseTemplateName&quot;: &quot;A String&quot;, # Optional. The resource name of the Model Armor template to use for response screening. A Model Armor template is a set of customized filters and thresholds that define how Model Armor screens content. If specified, Model Armor will use this template to check the model&#x27;s response for safety and security risks before it is returned to the user. The name must be in the format `projects/{project}/locations/{location}/templates/{template}`.
  },
  &quot;safetySettings&quot;: [ # Optional. Per request settings for blocking unsafe content. Enforced on GenerateContentResponse.candidates.
    { # A safety setting that affects the safety-blocking behavior. A SafetySetting consists of a harm category and a threshold for that category.
      &quot;category&quot;: &quot;A String&quot;, # Required. The harm category to be blocked.
      &quot;method&quot;: &quot;A String&quot;, # Optional. The method for blocking content. If not specified, the default behavior is to use the probability score.
      &quot;threshold&quot;: &quot;A String&quot;, # Required. The threshold for blocking content. If the harm probability exceeds this threshold, the content will be blocked.
    },
  ],
  &quot;systemInstruction&quot;: { # The structured data content of a message. A Content message contains a `role` field, which indicates the producer of the content, and a `parts` field, which contains the multi-part data of the message. # Optional. The user provided system instructions for the model. Note: only text should be used in parts and content in each part will be in a separate paragraph.
    &quot;parts&quot;: [ # Required. A list of Part objects that make up a single message. Parts of a message can have different MIME types. A Content message must have at least one Part.
      { # A datatype containing media that is part of a multi-part Content message. A `Part` consists of data which has an associated datatype. A `Part` can only contain one of the accepted types in `Part.data`. For media types that are not text, `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if `inline_data` or `file_data` field is filled with raw bytes.
        &quot;codeExecutionResult&quot;: { # Result of executing the [ExecutableCode]. Only generated when using the [CodeExecution] tool, and always follows a `part` containing the [ExecutableCode]. # Optional. The result of executing the ExecutableCode.
          &quot;outcome&quot;: &quot;A String&quot;, # Required. Outcome of the code execution.
          &quot;output&quot;: &quot;A String&quot;, # Optional. Contains stdout when code execution is successful, stderr or other description otherwise.
        },
        &quot;executableCode&quot;: { # Code generated by the model that is meant to be executed, and the result returned to the model. Generated when using the [CodeExecution] tool, in which the code will be automatically executed, and a corresponding [CodeExecutionResult] will also be generated. # Optional. Code generated by the model that is intended to be executed.
          &quot;code&quot;: &quot;A String&quot;, # Required. The code to be executed.
          &quot;language&quot;: &quot;A String&quot;, # Required. Programming language of the `code`.
        },
        &quot;fileData&quot;: { # URI-based data. A FileData message contains a URI pointing to data of a specific media type. It is used to represent images, audio, and video stored in Google Cloud Storage. # Optional. The URI-based data of the part. This can be used to include files from Google Cloud Storage.
          &quot;displayName&quot;: &quot;A String&quot;, # Optional. The display name of the file. Used to provide a label or filename to distinguish files. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server side tools (`code_execution`, `google_search`, and `url_context`) are enabled.
          &quot;fileUri&quot;: &quot;A String&quot;, # Required. The URI of the file in Google Cloud Storage.
          &quot;mimeType&quot;: &quot;A String&quot;, # Required. The IANA standard MIME type of the source data.
        },
        &quot;functionCall&quot;: { # A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing the parameters and their values. # Optional. A predicted function call returned from the model. This contains the name of the function to call and the arguments to pass to the function.
          &quot;args&quot;: { # Optional. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.
            &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
          },
          &quot;name&quot;: &quot;A String&quot;, # Optional. The name of the function to call. Matches [FunctionDeclaration.name].
        },
        &quot;functionResponse&quot;: { # The result output from a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a [FunctionCall] made based on model prediction. # Optional. The result of a function call. This is used to provide the model with the result of a function call that it predicted.
          &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].
          &quot;parts&quot;: [ # Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types.
            { # A datatype containing media that is part of a `FunctionResponse` message. A `FunctionResponsePart` consists of data which has an associated datatype. A `FunctionResponsePart` can only contain one of the accepted types in `FunctionResponsePart.data`. A `FunctionResponsePart` must have a fixed IANA MIME type identifying the type and subtype of the media if the `inline_data` field is filled with raw bytes.
              &quot;fileData&quot;: { # URI based data for function response. # URI based data.
                &quot;displayName&quot;: &quot;A String&quot;, # Optional. Display name of the file data. Used to provide a label or filename to distinguish file datas. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled.
                &quot;fileUri&quot;: &quot;A String&quot;, # Required. URI.
                &quot;mimeType&quot;: &quot;A String&quot;, # Required. The IANA standard MIME type of the source data.
              },
              &quot;inlineData&quot;: { # Raw media bytes for function response. Text should not be sent as raw bytes, use the &#x27;text&#x27; field. # Inline media bytes.
                &quot;data&quot;: &quot;A String&quot;, # Required. Raw bytes.
                &quot;displayName&quot;: &quot;A String&quot;, # Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled.
                &quot;mimeType&quot;: &quot;A String&quot;, # Required. The IANA standard MIME type of the source data.
              },
            },
          ],
          &quot;response&quot;: { # Required. The function response in JSON object format. Use &quot;output&quot; key to specify function output and &quot;error&quot; key to specify error details (if any). If &quot;output&quot; and &quot;error&quot; keys are not specified, then whole &quot;response&quot; is treated as function output.
            &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
          },
        },
        &quot;inlineData&quot;: { # A content blob. A Blob contains data of a specific media type. It is used to represent images, audio, and video. # Optional. The inline data content of the part. This can be used to include images, audio, or video in a request.
          &quot;data&quot;: &quot;A String&quot;, # Required. The raw bytes of the data.
          &quot;displayName&quot;: &quot;A String&quot;, # Optional. The display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server-side tools (`code_execution`, `google_search`, and `url_context`) are enabled.
          &quot;mimeType&quot;: &quot;A String&quot;, # Required. The IANA standard MIME type of the source data.
        },
        &quot;text&quot;: &quot;A String&quot;, # Optional. The text content of the part.
        &quot;thought&quot;: True or False, # Optional. Indicates whether the `part` represents the model&#x27;s thought process or reasoning.
        &quot;thoughtSignature&quot;: &quot;A String&quot;, # Optional. An opaque signature for the thought so it can be reused in subsequent requests.
        &quot;videoMetadata&quot;: { # Provides metadata for a video, including the start and end offsets for clipping and the frame rate. # Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.
          &quot;endOffset&quot;: &quot;A String&quot;, # Optional. The end offset of the video.
          &quot;fps&quot;: 3.14, # Optional. The frame rate of the video sent to the model. If not specified, the default value is 1.0. The valid range is (0.0, 24.0].
          &quot;startOffset&quot;: &quot;A String&quot;, # Optional. The start offset of the video.
        },
      },
    ],
    &quot;role&quot;: &quot;A String&quot;, # Optional. The producer of the content. Must be either &#x27;user&#x27; or &#x27;model&#x27;. If not set, the service will default to &#x27;user&#x27;.
  },
  &quot;toolConfig&quot;: { # Tool config. This config is shared for all tools provided in the request. # Optional. Tool config. This config is shared for all tools provided in the request.
    &quot;functionCallingConfig&quot;: { # Function calling config. # Optional. Function calling config.
      &quot;allowedFunctionNames&quot;: [ # Optional. Function names to call. Only set when the Mode is ANY. Function names should match [FunctionDeclaration.name]. With mode set to ANY, model will predict a function call from the set of function names provided.
        &quot;A String&quot;,
      ],
      &quot;mode&quot;: &quot;A String&quot;, # Optional. Function calling mode.
    },
    &quot;retrievalConfig&quot;: { # Retrieval config. # Optional. Retrieval config.
      &quot;languageCode&quot;: &quot;A String&quot;, # The language code of the user.
      &quot;latLng&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # The location of the user.
        &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
        &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
      },
    },
  },
  &quot;tools&quot;: [ # Optional. A list of `Tools` the model may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model.
    { # Tool details that the model may use to generate response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model. A Tool object should contain exactly one type of Tool (e.g FunctionDeclaration, Retrieval or GoogleSearchRetrieval).
      &quot;codeExecution&quot;: { # Tool that executes code generated by the model, and automatically returns the result to the model. See also [ExecutableCode]and [CodeExecutionResult] which are input and output to this tool. # Optional. CodeExecution tool type. Enables the model to execute code as part of generation.
      },
      &quot;computerUse&quot;: { # Tool to support computer use. # Optional. Tool to support the model interacting directly with the computer. If enabled, it automatically populates computer-use specific Function Declarations.
        &quot;environment&quot;: &quot;A String&quot;, # Required. The environment being operated.
        &quot;excludedPredefinedFunctions&quot;: [ # Optional. By default, [predefined functions](https://cloud.google.com/vertex-ai/generative-ai/docs/computer-use#supported-actions) are included in the final model call. Some of them can be explicitly excluded from being automatically included. This can serve two purposes: 1. Using a more restricted / different action space. 2. Improving the definitions / instructions of predefined functions.
          &quot;A String&quot;,
        ],
      },
      &quot;enterpriseWebSearch&quot;: { # Tool to search public web data, powered by Vertex AI Search and Sec4 compliance. # Optional. Tool to support searching public web data, powered by Vertex AI Search and Sec4 compliance.
        &quot;blockingConfidence&quot;: &quot;A String&quot;, # Optional. Sites with confidence level chosen &amp; above this value will be blocked from the search results.
        &quot;excludeDomains&quot;: [ # Optional. List of domains to be excluded from the search results. The default limit is 2000 domains.
          &quot;A String&quot;,
        ],
      },
      &quot;functionDeclarations&quot;: [ # Optional. Function tool type. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating FunctionCall in the response. User should provide a FunctionResponse for each function call in the next turn. Based on the function responses, Model will generate the final response back to the user. Maximum 512 function declarations can be provided.
        { # Structured representation of a function declaration as defined by the [OpenAPI 3.0 specification](https://spec.openapis.org/oas/v3.0.3). Included in this declaration are the function name, description, parameters and response type. This FunctionDeclaration is a representation of a block of code that can be used as a `Tool` by the model and executed by the client.
          &quot;description&quot;: &quot;A String&quot;, # Optional. Description and purpose of the function. Model uses it to decide how and whether to call the function.
          &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to call. Must start with a letter or an underscore. Must be a-z, A-Z, 0-9, or contain underscores, dots and dashes, with a maximum length of 64.
          &quot;parameters&quot;: { # Schema is used to define the format of input/output data. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may be added in the future as needed. # Optional. Describes the parameters to this function in JSON Schema Object format. Reflects the Open API 3.03 Parameter Object. string Key: the name of the parameter. Parameter names are case sensitive. Schema Value: the Schema defining the type used for the parameter. For function with no parameters, this can be left unset. Parameter names must start with a letter or an underscore and must only contain chars a-z, A-Z, 0-9, or underscores with a maximum length of 64. Example with 1 required and 1 optional parameter: type: OBJECT properties: param1: type: STRING param2: type: INTEGER required: - param1
            &quot;additionalProperties&quot;: &quot;&quot;, # Optional. Can either be a boolean or an object; controls the presence of additional properties.
            &quot;anyOf&quot;: [ # Optional. The value should be validated against any (one or more) of the subschemas in the list.
              # Object with schema name: GoogleCloudAiplatformV1Schema
            ],
            &quot;default&quot;: &quot;&quot;, # Optional. Default value of the data.
            &quot;defs&quot;: { # Optional. A map of definitions for use by `ref` Only allowed at the root of the schema.
              &quot;a_key&quot;: # Object with schema name: GoogleCloudAiplatformV1Schema
            },
            &quot;description&quot;: &quot;A String&quot;, # Optional. The description of the data.
            &quot;enum&quot;: [ # Optional. Possible values of the element of primitive type with enum format. Examples: 1. We can define direction as : {type:STRING, format:enum, enum:[&quot;EAST&quot;, NORTH&quot;, &quot;SOUTH&quot;, &quot;WEST&quot;]} 2. We can define apartment number as : {type:INTEGER, format:enum, enum:[&quot;101&quot;, &quot;201&quot;, &quot;301&quot;]}
              &quot;A String&quot;,
            ],
            &quot;example&quot;: &quot;&quot;, # Optional. Example of the object. Will only populated when the object is the root.
            &quot;format&quot;: &quot;A String&quot;, # Optional. The format of the data. Supported formats: for NUMBER type: &quot;float&quot;, &quot;double&quot; for INTEGER type: &quot;int32&quot;, &quot;int64&quot; for STRING type: &quot;email&quot;, &quot;byte&quot;, etc
            &quot;items&quot;: # Object with schema name: GoogleCloudAiplatformV1Schema # Optional. SCHEMA FIELDS FOR TYPE ARRAY Schema of the elements of Type.ARRAY.
            &quot;maxItems&quot;: &quot;A String&quot;, # Optional. Maximum number of the elements for Type.ARRAY.
            &quot;maxLength&quot;: &quot;A String&quot;, # Optional. Maximum length of the Type.STRING
            &quot;maxProperties&quot;: &quot;A String&quot;, # Optional. Maximum number of the properties for Type.OBJECT.
            &quot;maximum&quot;: 3.14, # Optional. Maximum value of the Type.INTEGER and Type.NUMBER
            &quot;minItems&quot;: &quot;A String&quot;, # Optional. Minimum number of the elements for Type.ARRAY.
            &quot;minLength&quot;: &quot;A String&quot;, # Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING
            &quot;minProperties&quot;: &quot;A String&quot;, # Optional. Minimum number of the properties for Type.OBJECT.
            &quot;minimum&quot;: 3.14, # Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER
            &quot;nullable&quot;: True or False, # Optional. Indicates if the value may be null.
            &quot;pattern&quot;: &quot;A String&quot;, # Optional. Pattern of the Type.STRING to restrict a string to a regular expression.
            &quot;properties&quot;: { # Optional. SCHEMA FIELDS FOR TYPE OBJECT Properties of Type.OBJECT.
              &quot;a_key&quot;: # Object with schema name: GoogleCloudAiplatformV1Schema
            },
            &quot;propertyOrdering&quot;: [ # Optional. The order of the properties. Not a standard field in open api spec. Only used to support the order of the properties.
              &quot;A String&quot;,
            ],
            &quot;ref&quot;: &quot;A String&quot;, # Optional. Allows indirect references between schema nodes. The value should be a valid reference to a child of the root `defs`. For example, the following schema defines a reference to a schema node named &quot;Pet&quot;: type: object properties: pet: ref: #/defs/Pet defs: Pet: type: object properties: name: type: string The value of the &quot;pet&quot; property is a reference to the schema node named &quot;Pet&quot;. See details in https://json-schema.org/understanding-json-schema/structuring
            &quot;required&quot;: [ # Optional. Required properties of Type.OBJECT.
              &quot;A String&quot;,
            ],
            &quot;title&quot;: &quot;A String&quot;, # Optional. The title of the Schema.
            &quot;type&quot;: &quot;A String&quot;, # Optional. The type of the data.
          },
          &quot;parametersJsonSchema&quot;: &quot;&quot;, # Optional. Describes the parameters to the function in JSON Schema format. The schema must describe an object where the properties are the parameters to the function. For example: ``` { &quot;type&quot;: &quot;object&quot;, &quot;properties&quot;: { &quot;name&quot;: { &quot;type&quot;: &quot;string&quot; }, &quot;age&quot;: { &quot;type&quot;: &quot;integer&quot; } }, &quot;additionalProperties&quot;: false, &quot;required&quot;: [&quot;name&quot;, &quot;age&quot;], &quot;propertyOrdering&quot;: [&quot;name&quot;, &quot;age&quot;] } ``` This field is mutually exclusive with `parameters`.
          &quot;response&quot;: { # Schema is used to define the format of input/output data. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may be added in the future as needed. # Optional. Describes the output from this function in JSON Schema format. Reflects the Open API 3.03 Response Object. The Schema defines the type used for the response value of the function.
            &quot;additionalProperties&quot;: &quot;&quot;, # Optional. Can either be a boolean or an object; controls the presence of additional properties.
            &quot;anyOf&quot;: [ # Optional. The value should be validated against any (one or more) of the subschemas in the list.
              # Object with schema name: GoogleCloudAiplatformV1Schema
            ],
            &quot;default&quot;: &quot;&quot;, # Optional. Default value of the data.
            &quot;defs&quot;: { # Optional. A map of definitions for use by `ref` Only allowed at the root of the schema.
              &quot;a_key&quot;: # Object with schema name: GoogleCloudAiplatformV1Schema
            },
            &quot;description&quot;: &quot;A String&quot;, # Optional. The description of the data.
            &quot;enum&quot;: [ # Optional. Possible values of the element of primitive type with enum format. Examples: 1. We can define direction as : {type:STRING, format:enum, enum:[&quot;EAST&quot;, NORTH&quot;, &quot;SOUTH&quot;, &quot;WEST&quot;]} 2. We can define apartment number as : {type:INTEGER, format:enum, enum:[&quot;101&quot;, &quot;201&quot;, &quot;301&quot;]}
              &quot;A String&quot;,
            ],
            &quot;example&quot;: &quot;&quot;, # Optional. Example of the object. Will only populated when the object is the root.
            &quot;format&quot;: &quot;A String&quot;, # Optional. The format of the data. Supported formats: for NUMBER type: &quot;float&quot;, &quot;double&quot; for INTEGER type: &quot;int32&quot;, &quot;int64&quot; for STRING type: &quot;email&quot;, &quot;byte&quot;, etc
            &quot;items&quot;: # Object with schema name: GoogleCloudAiplatformV1Schema # Optional. SCHEMA FIELDS FOR TYPE ARRAY Schema of the elements of Type.ARRAY.
            &quot;maxItems&quot;: &quot;A String&quot;, # Optional. Maximum number of the elements for Type.ARRAY.
            &quot;maxLength&quot;: &quot;A String&quot;, # Optional. Maximum length of the Type.STRING
            &quot;maxProperties&quot;: &quot;A String&quot;, # Optional. Maximum number of the properties for Type.OBJECT.
            &quot;maximum&quot;: 3.14, # Optional. Maximum value of the Type.INTEGER and Type.NUMBER
            &quot;minItems&quot;: &quot;A String&quot;, # Optional. Minimum number of the elements for Type.ARRAY.
            &quot;minLength&quot;: &quot;A String&quot;, # Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING
            &quot;minProperties&quot;: &quot;A String&quot;, # Optional. Minimum number of the properties for Type.OBJECT.
            &quot;minimum&quot;: 3.14, # Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER
            &quot;nullable&quot;: True or False, # Optional. Indicates if the value may be null.
            &quot;pattern&quot;: &quot;A String&quot;, # Optional. Pattern of the Type.STRING to restrict a string to a regular expression.
            &quot;properties&quot;: { # Optional. SCHEMA FIELDS FOR TYPE OBJECT Properties of Type.OBJECT.
              &quot;a_key&quot;: # Object with schema name: GoogleCloudAiplatformV1Schema
            },
            &quot;propertyOrdering&quot;: [ # Optional. The order of the properties. Not a standard field in open api spec. Only used to support the order of the properties.
              &quot;A String&quot;,
            ],
            &quot;ref&quot;: &quot;A String&quot;, # Optional. Allows indirect references between schema nodes. The value should be a valid reference to a child of the root `defs`. For example, the following schema defines a reference to a schema node named &quot;Pet&quot;: type: object properties: pet: ref: #/defs/Pet defs: Pet: type: object properties: name: type: string The value of the &quot;pet&quot; property is a reference to the schema node named &quot;Pet&quot;. See details in https://json-schema.org/understanding-json-schema/structuring
            &quot;required&quot;: [ # Optional. Required properties of Type.OBJECT.
              &quot;A String&quot;,
            ],
            &quot;title&quot;: &quot;A String&quot;, # Optional. The title of the Schema.
            &quot;type&quot;: &quot;A String&quot;, # Optional. The type of the data.
          },
          &quot;responseJsonSchema&quot;: &quot;&quot;, # Optional. Describes the output from this function in JSON Schema format. The value specified by the schema is the response value of the function. This field is mutually exclusive with `response`.
        },
      ],
      &quot;googleMaps&quot;: { # Tool to retrieve public maps data for grounding, powered by Google. # Optional. GoogleMaps tool type. Tool to support Google Maps in Model.
        &quot;enableWidget&quot;: True or False, # Optional. If true, include the widget context token in the response.
      },
      &quot;googleSearch&quot;: { # GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google. # Optional. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google.
        &quot;blockingConfidence&quot;: &quot;A String&quot;, # Optional. Sites with confidence level chosen &amp; above this value will be blocked from the search results.
        &quot;excludeDomains&quot;: [ # Optional. List of domains to be excluded from the search results. The default limit is 2000 domains. Example: [&quot;amazon.com&quot;, &quot;facebook.com&quot;].
          &quot;A String&quot;,
        ],
      },
      &quot;googleSearchRetrieval&quot;: { # Tool to retrieve public web data for grounding, powered by Google. # Optional. Specialized retrieval tool that is powered by Google Search.
        &quot;dynamicRetrievalConfig&quot;: { # Describes the options to customize dynamic retrieval. # Specifies the dynamic retrieval configuration for the given source.
          &quot;dynamicThreshold&quot;: 3.14, # Optional. The threshold to be used in dynamic retrieval. If not set, a system default value is used.
          &quot;mode&quot;: &quot;A String&quot;, # The mode of the predictor to be used in dynamic retrieval.
        },
      },
      &quot;retrieval&quot;: { # Defines a retrieval tool that model can call to access external knowledge. # Optional. Retrieval tool type. System will always execute the provided retrieval tool(s) to get external knowledge to answer the prompt. Retrieval results are presented to the model for generation.
        &quot;disableAttribution&quot;: True or False, # Optional. Deprecated. This option is no longer supported.
        &quot;externalApi&quot;: { # Retrieve from data source powered by external API for grounding. The external API is not owned by Google, but need to follow the pre-defined API spec. # Use data source powered by external API for grounding.
          &quot;apiAuth&quot;: { # The generic reusable api auth config. Deprecated. Please use AuthConfig (google/cloud/aiplatform/master/auth.proto) instead. # The authentication config to access the API. Deprecated. Please use auth_config instead.
            &quot;apiKeyConfig&quot;: { # The API secret. # The API secret.
              &quot;apiKeySecretVersion&quot;: &quot;A String&quot;, # Required. The SecretManager secret version resource name storing API key. e.g. projects/{project}/secrets/{secret}/versions/{version}
              &quot;apiKeyString&quot;: &quot;A String&quot;, # The API key string. Either this or `api_key_secret_version` must be set.
            },
          },
          &quot;apiSpec&quot;: &quot;A String&quot;, # The API spec that the external API implements.
          &quot;authConfig&quot;: { # Auth configuration to run the extension. # The authentication config to access the API.
            &quot;apiKeyConfig&quot;: { # Config for authentication with API key. # Config for API key auth.
              &quot;apiKeySecret&quot;: &quot;A String&quot;, # Optional. The name of the SecretManager secret version resource storing the API key. Format: `projects/{project}/secrets/{secrete}/versions/{version}` - If both `api_key_secret` and `api_key_string` are specified, this field takes precedence over `api_key_string`. - If specified, the `secretmanager.versions.access` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified resource.
              &quot;apiKeyString&quot;: &quot;A String&quot;, # Optional. The API key to be used in the request directly.
              &quot;httpElementLocation&quot;: &quot;A String&quot;, # Optional. The location of the API key.
              &quot;name&quot;: &quot;A String&quot;, # Optional. The parameter name of the API key. E.g. If the API request is &quot;https://example.com/act?api_key=&quot;, &quot;api_key&quot; would be the parameter name.
            },
            &quot;authType&quot;: &quot;A String&quot;, # Type of auth scheme.
            &quot;googleServiceAccountConfig&quot;: { # Config for Google Service Account Authentication. # Config for Google Service Account auth.
              &quot;serviceAccount&quot;: &quot;A String&quot;, # Optional. The service account that the extension execution service runs as. - If the service account is specified, the `iam.serviceAccounts.getAccessToken` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified service account. - If not specified, the Vertex AI Extension Service Agent will be used to execute the Extension.
            },
            &quot;httpBasicAuthConfig&quot;: { # Config for HTTP Basic Authentication. # Config for HTTP Basic auth.
              &quot;credentialSecret&quot;: &quot;A String&quot;, # Required. The name of the SecretManager secret version resource storing the base64 encoded credentials. Format: `projects/{project}/secrets/{secrete}/versions/{version}` - If specified, the `secretmanager.versions.access` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified resource.
            },
            &quot;oauthConfig&quot;: { # Config for user oauth. # Config for user oauth.
              &quot;accessToken&quot;: &quot;A String&quot;, # Access token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time.
              &quot;serviceAccount&quot;: &quot;A String&quot;, # The service account used to generate access tokens for executing the Extension. - If the service account is specified, the `iam.serviceAccounts.getAccessToken` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the provided service account.
            },
            &quot;oidcConfig&quot;: { # Config for user OIDC auth. # Config for user OIDC auth.
              &quot;idToken&quot;: &quot;A String&quot;, # OpenID Connect formatted ID token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time.
              &quot;serviceAccount&quot;: &quot;A String&quot;, # The service account used to generate an OpenID Connect (OIDC)-compatible JWT token signed by the Google OIDC Provider (accounts.google.com) for extension endpoint (https://cloud.google.com/iam/docs/create-short-lived-credentials-direct#sa-credentials-oidc). - The audience for the token will be set to the URL in the server url defined in the OpenApi spec. - If the service account is provided, the service account should grant `iam.serviceAccounts.getOpenIdToken` permission to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents).
            },
          },
          &quot;elasticSearchParams&quot;: { # The search parameters to use for the ELASTIC_SEARCH spec. # Parameters for the elastic search API.
            &quot;index&quot;: &quot;A String&quot;, # The ElasticSearch index to use.
            &quot;numHits&quot;: 42, # Optional. Number of hits (chunks) to request. When specified, it is passed to Elasticsearch as the `num_hits` param.
            &quot;searchTemplate&quot;: &quot;A String&quot;, # The ElasticSearch search template to use.
          },
          &quot;endpoint&quot;: &quot;A String&quot;, # The endpoint of the external API. The system will call the API at this endpoint to retrieve the data for grounding. Example: https://acme.com:443/search
          &quot;simpleSearchParams&quot;: { # The search parameters to use for SIMPLE_SEARCH spec. # Parameters for the simple search API.
          },
        },
        &quot;vertexAiSearch&quot;: { # Retrieve from Vertex AI Search datastore or engine for grounding. datastore and engine are mutually exclusive. See https://cloud.google.com/products/agent-builder # Set to use data source powered by Vertex AI Search.
          &quot;dataStoreSpecs&quot;: [ # Specifications that define the specific DataStores to be searched, along with configurations for those data stores. This is only considered for Engines with multiple data stores. It should only be set if engine is used.
            { # Define data stores within engine to filter on in a search call and configurations for those data stores. For more information, see https://cloud.google.com/generative-ai-app-builder/docs/reference/rpc/google.cloud.discoveryengine.v1#datastorespec
              &quot;dataStore&quot;: &quot;A String&quot;, # Full resource name of DataStore, such as Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}`
              &quot;filter&quot;: &quot;A String&quot;, # Optional. Filter specification to filter documents in the data store specified by data_store field. For more information on filtering, see [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
            },
          ],
          &quot;datastore&quot;: &quot;A String&quot;, # Optional. Fully-qualified Vertex AI Search data store resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}`
          &quot;engine&quot;: &quot;A String&quot;, # Optional. Fully-qualified Vertex AI Search engine resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}`
          &quot;filter&quot;: &quot;A String&quot;, # Optional. Filter strings to be passed to the search API.
          &quot;maxResults&quot;: 42, # Optional. Number of search results to return per query. The default value is 10. The maximumm allowed value is 10.
        },
        &quot;vertexRagStore&quot;: { # Retrieve from Vertex RAG Store for grounding. # Set to use data source powered by Vertex RAG store. User data is uploaded via the VertexRagDataService.
          &quot;ragResources&quot;: [ # Optional. The representation of the rag source. It can be used to specify corpus only or ragfiles. Currently only support one corpus or multiple files from one corpus. In the future we may open up multiple corpora support.
            { # The definition of the Rag resource.
              &quot;ragCorpus&quot;: &quot;A String&quot;, # Optional. RagCorpora resource name. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`
              &quot;ragFileIds&quot;: [ # Optional. rag_file_id. The files should be in the same rag_corpus set in rag_corpus field.
                &quot;A String&quot;,
              ],
            },
          ],
          &quot;ragRetrievalConfig&quot;: { # Specifies the context retrieval config. # Optional. The retrieval config for the Rag query.
            &quot;filter&quot;: { # Config for filters. # Optional. Config for filters.
              &quot;metadataFilter&quot;: &quot;A String&quot;, # Optional. String for metadata filtering.
              &quot;vectorDistanceThreshold&quot;: 3.14, # Optional. Only returns contexts with vector distance smaller than the threshold.
              &quot;vectorSimilarityThreshold&quot;: 3.14, # Optional. Only returns contexts with vector similarity larger than the threshold.
            },
            &quot;ranking&quot;: { # Config for ranking and reranking. # Optional. Config for ranking and reranking.
              &quot;llmRanker&quot;: { # Config for LlmRanker. # Optional. Config for LlmRanker.
                &quot;modelName&quot;: &quot;A String&quot;, # Optional. The model name used for ranking. See [Supported models](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/inference#supported-models).
              },
              &quot;rankService&quot;: { # Config for Rank Service. # Optional. Config for Rank Service.
                &quot;modelName&quot;: &quot;A String&quot;, # Optional. The model name of the rank service. Format: `semantic-ranker-512@latest`
              },
            },
            &quot;topK&quot;: 42, # Optional. The number of contexts to retrieve.
          },
          &quot;similarityTopK&quot;: 42, # Optional. Number of top k results to return from the selected corpora.
          &quot;vectorDistanceThreshold&quot;: 3.14, # Optional. Only return results with vector distance smaller than the threshold.
        },
      },
      &quot;urlContext&quot;: { # Tool to support URL context. # Optional. Tool to support URL context retrieval.
      },
    },
  ],
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Response message for [PredictionService.GenerateContent].
  &quot;candidates&quot;: [ # Output only. Generated candidates.
    { # A response candidate generated from the model.
      &quot;avgLogprobs&quot;: 3.14, # Output only. The average log probability of the tokens in this candidate. This is a length-normalized score that can be used to compare the quality of candidates of different lengths. A higher average log probability suggests a more confident and coherent response.
      &quot;citationMetadata&quot;: { # A collection of citations that apply to a piece of generated content. # Output only. A collection of citations that apply to the generated content.
        &quot;citations&quot;: [ # Output only. A list of citations for the content.
          { # A citation for a piece of generatedcontent.
            &quot;endIndex&quot;: 42, # Output only. The end index of the citation in the content.
            &quot;license&quot;: &quot;A String&quot;, # Output only. The license of the source of the citation.
            &quot;publicationDate&quot;: { # Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following: * A full date, with non-zero year, month, and day values. * A month and day, with a zero year (for example, an anniversary). * A year on its own, with a zero month and a zero day. * A year and month, with a zero day (for example, a credit card expiration date). Related types: * google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp # Output only. The publication date of the source of the citation.
              &quot;day&quot;: 42, # Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn&#x27;t significant.
              &quot;month&quot;: 42, # Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
              &quot;year&quot;: 42, # Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
            },
            &quot;startIndex&quot;: 42, # Output only. The start index of the citation in the content.
            &quot;title&quot;: &quot;A String&quot;, # Output only. The title of the source of the citation.
            &quot;uri&quot;: &quot;A String&quot;, # Output only. The URI of the source of the citation.
          },
        ],
      },
      &quot;content&quot;: { # The structured data content of a message. A Content message contains a `role` field, which indicates the producer of the content, and a `parts` field, which contains the multi-part data of the message. # Output only. The content of the candidate.
        &quot;parts&quot;: [ # Required. A list of Part objects that make up a single message. Parts of a message can have different MIME types. A Content message must have at least one Part.
          { # A datatype containing media that is part of a multi-part Content message. A `Part` consists of data which has an associated datatype. A `Part` can only contain one of the accepted types in `Part.data`. For media types that are not text, `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if `inline_data` or `file_data` field is filled with raw bytes.
            &quot;codeExecutionResult&quot;: { # Result of executing the [ExecutableCode]. Only generated when using the [CodeExecution] tool, and always follows a `part` containing the [ExecutableCode]. # Optional. The result of executing the ExecutableCode.
              &quot;outcome&quot;: &quot;A String&quot;, # Required. Outcome of the code execution.
              &quot;output&quot;: &quot;A String&quot;, # Optional. Contains stdout when code execution is successful, stderr or other description otherwise.
            },
            &quot;executableCode&quot;: { # Code generated by the model that is meant to be executed, and the result returned to the model. Generated when using the [CodeExecution] tool, in which the code will be automatically executed, and a corresponding [CodeExecutionResult] will also be generated. # Optional. Code generated by the model that is intended to be executed.
              &quot;code&quot;: &quot;A String&quot;, # Required. The code to be executed.
              &quot;language&quot;: &quot;A String&quot;, # Required. Programming language of the `code`.
            },
            &quot;fileData&quot;: { # URI-based data. A FileData message contains a URI pointing to data of a specific media type. It is used to represent images, audio, and video stored in Google Cloud Storage. # Optional. The URI-based data of the part. This can be used to include files from Google Cloud Storage.
              &quot;displayName&quot;: &quot;A String&quot;, # Optional. The display name of the file. Used to provide a label or filename to distinguish files. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server side tools (`code_execution`, `google_search`, and `url_context`) are enabled.
              &quot;fileUri&quot;: &quot;A String&quot;, # Required. The URI of the file in Google Cloud Storage.
              &quot;mimeType&quot;: &quot;A String&quot;, # Required. The IANA standard MIME type of the source data.
            },
            &quot;functionCall&quot;: { # A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing the parameters and their values. # Optional. A predicted function call returned from the model. This contains the name of the function to call and the arguments to pass to the function.
              &quot;args&quot;: { # Optional. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.
                &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
              },
              &quot;name&quot;: &quot;A String&quot;, # Optional. The name of the function to call. Matches [FunctionDeclaration.name].
            },
            &quot;functionResponse&quot;: { # The result output from a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a [FunctionCall] made based on model prediction. # Optional. The result of a function call. This is used to provide the model with the result of a function call that it predicted.
              &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].
              &quot;parts&quot;: [ # Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types.
                { # A datatype containing media that is part of a `FunctionResponse` message. A `FunctionResponsePart` consists of data which has an associated datatype. A `FunctionResponsePart` can only contain one of the accepted types in `FunctionResponsePart.data`. A `FunctionResponsePart` must have a fixed IANA MIME type identifying the type and subtype of the media if the `inline_data` field is filled with raw bytes.
                  &quot;fileData&quot;: { # URI based data for function response. # URI based data.
                    &quot;displayName&quot;: &quot;A String&quot;, # Optional. Display name of the file data. Used to provide a label or filename to distinguish file datas. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled.
                    &quot;fileUri&quot;: &quot;A String&quot;, # Required. URI.
                    &quot;mimeType&quot;: &quot;A String&quot;, # Required. The IANA standard MIME type of the source data.
                  },
                  &quot;inlineData&quot;: { # Raw media bytes for function response. Text should not be sent as raw bytes, use the &#x27;text&#x27; field. # Inline media bytes.
                    &quot;data&quot;: &quot;A String&quot;, # Required. Raw bytes.
                    &quot;displayName&quot;: &quot;A String&quot;, # Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled.
                    &quot;mimeType&quot;: &quot;A String&quot;, # Required. The IANA standard MIME type of the source data.
                  },
                },
              ],
              &quot;response&quot;: { # Required. The function response in JSON object format. Use &quot;output&quot; key to specify function output and &quot;error&quot; key to specify error details (if any). If &quot;output&quot; and &quot;error&quot; keys are not specified, then whole &quot;response&quot; is treated as function output.
                &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
              },
            },
            &quot;inlineData&quot;: { # A content blob. A Blob contains data of a specific media type. It is used to represent images, audio, and video. # Optional. The inline data content of the part. This can be used to include images, audio, or video in a request.
              &quot;data&quot;: &quot;A String&quot;, # Required. The raw bytes of the data.
              &quot;displayName&quot;: &quot;A String&quot;, # Optional. The display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server-side tools (`code_execution`, `google_search`, and `url_context`) are enabled.
              &quot;mimeType&quot;: &quot;A String&quot;, # Required. The IANA standard MIME type of the source data.
            },
            &quot;text&quot;: &quot;A String&quot;, # Optional. The text content of the part.
            &quot;thought&quot;: True or False, # Optional. Indicates whether the `part` represents the model&#x27;s thought process or reasoning.
            &quot;thoughtSignature&quot;: &quot;A String&quot;, # Optional. An opaque signature for the thought so it can be reused in subsequent requests.
            &quot;videoMetadata&quot;: { # Provides metadata for a video, including the start and end offsets for clipping and the frame rate. # Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.
              &quot;endOffset&quot;: &quot;A String&quot;, # Optional. The end offset of the video.
              &quot;fps&quot;: 3.14, # Optional. The frame rate of the video sent to the model. If not specified, the default value is 1.0. The valid range is (0.0, 24.0].
              &quot;startOffset&quot;: &quot;A String&quot;, # Optional. The start offset of the video.
            },
          },
        ],
        &quot;role&quot;: &quot;A String&quot;, # Optional. The producer of the content. Must be either &#x27;user&#x27; or &#x27;model&#x27;. If not set, the service will default to &#x27;user&#x27;.
      },
      &quot;finishMessage&quot;: &quot;A String&quot;, # Output only. Describes the reason the model stopped generating tokens in more detail. This field is returned only when `finish_reason` is set.
      &quot;finishReason&quot;: &quot;A String&quot;, # Output only. The reason why the model stopped generating tokens. If empty, the model has not stopped generating.
      &quot;groundingMetadata&quot;: { # Information about the sources that support the content of a response. When grounding is enabled, the model returns citations for claims in the response. This object contains the retrieved sources. # Output only. Metadata returned when grounding is enabled. It contains the sources used to ground the generated content.
        &quot;googleMapsWidgetContextToken&quot;: &quot;A String&quot;, # Optional. Output only. A token that can be used to render a Google Maps widget with the contextual data. This field is populated only when the grounding source is Google Maps.
        &quot;groundingChunks&quot;: [ # A list of supporting references retrieved from the grounding source. This field is populated when the grounding source is Google Search, Vertex AI Search, or Google Maps.
          { # A piece of evidence that supports a claim made by the model. This is used to show a citation for a claim made by the model. When grounding is enabled, the model returns a `GroundingChunk` that contains a reference to the source of the information.
            &quot;maps&quot;: { # A `Maps` chunk is a piece of evidence that comes from Google Maps. It contains information about a place, such as its name, address, and reviews. This is used to provide the user with rich, location-based information. # A grounding chunk from Google Maps. See the `Maps` message for details.
              &quot;placeAnswerSources&quot;: { # The sources that were used to generate the place answer. This includes review snippets and photos that were used to generate the answer, as well as URIs to flag content. # The sources that were used to generate the place answer. This includes review snippets and photos that were used to generate the answer, as well as URIs to flag content.
                &quot;reviewSnippets&quot;: [ # Snippets of reviews that were used to generate the answer.
                  { # A review snippet that is used to generate the answer.
                    &quot;googleMapsUri&quot;: &quot;A String&quot;, # A link to show the review on Google Maps.
                    &quot;reviewId&quot;: &quot;A String&quot;, # The ID of the review that is being referenced.
                    &quot;title&quot;: &quot;A String&quot;, # The title of the review.
                  },
                ],
              },
              &quot;placeId&quot;: &quot;A String&quot;, # This Place&#x27;s resource name, in `places/{place_id}` format. This can be used to look up the place in the Google Maps API.
              &quot;text&quot;: &quot;A String&quot;, # The text of the place answer.
              &quot;title&quot;: &quot;A String&quot;, # The title of the place.
              &quot;uri&quot;: &quot;A String&quot;, # The URI of the place.
            },
            &quot;retrievedContext&quot;: { # Context retrieved from a data source to ground the model&#x27;s response. This is used when a retrieval tool fetches information from a user-provided corpus or a public dataset. # A grounding chunk from a data source retrieved by a retrieval tool, such as Vertex AI Search. See the `RetrievedContext` message for details
              &quot;documentName&quot;: &quot;A String&quot;, # Output only. The full resource name of the referenced Vertex AI Search document. This is used to identify the specific document that was retrieved. The format is `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`.
              &quot;ragChunk&quot;: { # A RagChunk includes the content of a chunk of a RagFile, and associated metadata. # Additional context for a Retrieval-Augmented Generation (RAG) retrieval result. This is populated only when the RAG retrieval tool is used.
                &quot;pageSpan&quot;: { # Represents where the chunk starts and ends in the document. # If populated, represents where the chunk starts and ends in the document.
                  &quot;firstPage&quot;: 42, # Page where chunk starts in the document. Inclusive. 1-indexed.
                  &quot;lastPage&quot;: 42, # Page where chunk ends in the document. Inclusive. 1-indexed.
                },
                &quot;text&quot;: &quot;A String&quot;, # The content of the chunk.
              },
              &quot;text&quot;: &quot;A String&quot;, # The content of the retrieved data source.
              &quot;title&quot;: &quot;A String&quot;, # The title of the retrieved data source.
              &quot;uri&quot;: &quot;A String&quot;, # The URI of the retrieved data source.
            },
            &quot;web&quot;: { # A `Web` chunk is a piece of evidence that comes from a web page. It contains the URI of the web page, the title of the page, and the domain of the page. This is used to provide the user with a link to the source of the information. # A grounding chunk from a web page, typically from Google Search. See the `Web` message for details.
              &quot;domain&quot;: &quot;A String&quot;, # The domain of the web page that contains the evidence. This can be used to filter out low-quality sources.
              &quot;title&quot;: &quot;A String&quot;, # The title of the web page that contains the evidence.
              &quot;uri&quot;: &quot;A String&quot;, # The URI of the web page that contains the evidence.
            },
          },
        ],
        &quot;groundingSupports&quot;: [ # Optional. A list of grounding supports that connect the generated content to the grounding chunks. This field is populated when the grounding source is Google Search or Vertex AI Search.
          { # A collection of supporting references for a segment of the model&#x27;s response.
            &quot;confidenceScores&quot;: [ # The confidence scores for the support references. This list is parallel to the `grounding_chunk_indices` list. A score is a value between 0.0 and 1.0, with a higher score indicating a higher confidence that the reference supports the claim. For Gemini 2.0 and before, this list has the same size as `grounding_chunk_indices`. For Gemini 2.5 and later, this list is empty and should be ignored.
              3.14,
            ],
            &quot;groundingChunkIndices&quot;: [ # A list of indices into the `grounding_chunks` field of the `GroundingMetadata` message. These indices specify which grounding chunks support the claim made in the content segment. For example, if this field has the values `[1, 3]`, it means that `grounding_chunks[1]` and `grounding_chunks[3]` are the sources for the claim in the content segment.
              42,
            ],
            &quot;segment&quot;: { # A segment of the content. # The content segment that this support message applies to.
              &quot;endIndex&quot;: 42, # Output only. The end index of the segment in the `Part`, measured in bytes. This marks the end of the segment and is exclusive, meaning the segment includes content up to, but not including, the byte at this index.
              &quot;partIndex&quot;: 42, # Output only. The index of the `Part` object that this segment belongs to. This is useful for associating the segment with a specific part of the content.
              &quot;startIndex&quot;: 42, # Output only. The start index of the segment in the `Part`, measured in bytes. This marks the beginning of the segment and is inclusive, meaning the byte at this index is the first byte of the segment.
              &quot;text&quot;: &quot;A String&quot;, # Output only. The text of the segment.
            },
          },
        ],
        &quot;retrievalMetadata&quot;: { # Metadata related to the retrieval grounding source. This is part of the `GroundingMetadata` returned when grounding is enabled. # Optional. Output only. Metadata related to the retrieval grounding source.
          &quot;googleSearchDynamicRetrievalScore&quot;: 3.14, # Optional. A score indicating how likely it is that a Google Search query could help answer the prompt. The score is in the range of `[0, 1]`. A score of 1 means the model is confident that a search will be helpful, and 0 means it is not. This score is populated only when Google Search grounding and dynamic retrieval are enabled. The score is used to determine whether to trigger a search.
        },
        &quot;searchEntryPoint&quot;: { # An entry point for displaying Google Search results. A `SearchEntryPoint` is populated when the grounding source for a model&#x27;s response is Google Search. It provides information that you can use to display the search results in your application. # Optional. A web search entry point that can be used to display search results. This field is populated only when the grounding source is Google Search.
          &quot;renderedContent&quot;: &quot;A String&quot;, # Optional. An HTML snippet that can be embedded in a web page or an application&#x27;s webview. This snippet displays a search result, including the title, URL, and a brief description of the search result.
          &quot;sdkBlob&quot;: &quot;A String&quot;, # Optional. A base64-encoded JSON object that contains a list of search queries and their corresponding search URLs. This information can be used to build a custom search UI.
        },
        &quot;sourceFlaggingUris&quot;: [ # Optional. Output only. A list of URIs that can be used to flag a place or review for inappropriate content. This field is populated only when the grounding source is Google Maps.
          { # A URI that can be used to flag a place or review for inappropriate content. This is populated only when the grounding source is Google Maps.
            &quot;flagContentUri&quot;: &quot;A String&quot;, # The URI that can be used to flag the content.
            &quot;sourceId&quot;: &quot;A String&quot;, # The ID of the place or review.
          },
        ],
        &quot;webSearchQueries&quot;: [ # Optional. The web search queries that were used to generate the content. This field is populated only when the grounding source is Google Search.
          &quot;A String&quot;,
        ],
      },
      &quot;index&quot;: 42, # Output only. The 0-based index of this candidate in the list of generated responses. This is useful for distinguishing between multiple candidates when `candidate_count` &gt; 1.
      &quot;logprobsResult&quot;: { # The log probabilities of the tokens generated by the model. This is useful for understanding the model&#x27;s confidence in its predictions and for debugging. For example, you can use log probabilities to identify when the model is making a less confident prediction or to explore alternative responses that the model considered. A low log probability can also indicate that the model is &quot;hallucinating&quot; or generating factually incorrect information. # Output only. The detailed log probability information for the tokens in this candidate. This is useful for debugging, understanding model uncertainty, and identifying potential &quot;hallucinations&quot;.
        &quot;chosenCandidates&quot;: [ # A list of the chosen candidate tokens at each decoding step. The length of this list is equal to the total number of decoding steps. Note that the chosen candidate might not be in `top_candidates`.
          { # A single token and its associated log probability.
            &quot;logProbability&quot;: 3.14, # The log probability of this token. A higher value indicates that the model was more confident in this token. The log probability can be used to assess the relative likelihood of different tokens and to identify when the model is uncertain.
            &quot;token&quot;: &quot;A String&quot;, # The token&#x27;s string representation.
            &quot;tokenId&quot;: 42, # The token&#x27;s numerical ID. While the `token` field provides the string representation of the token, the `token_id` is the numerical representation that the model uses internally. This can be useful for developers who want to build custom logic based on the model&#x27;s vocabulary.
          },
        ],
        &quot;topCandidates&quot;: [ # A list of the top candidate tokens at each decoding step. The length of this list is equal to the total number of decoding steps.
          { # A list of the top candidate tokens and their log probabilities at each decoding step. This can be used to see what other tokens the model considered.
            &quot;candidates&quot;: [ # The list of candidate tokens, sorted by log probability in descending order.
              { # A single token and its associated log probability.
                &quot;logProbability&quot;: 3.14, # The log probability of this token. A higher value indicates that the model was more confident in this token. The log probability can be used to assess the relative likelihood of different tokens and to identify when the model is uncertain.
                &quot;token&quot;: &quot;A String&quot;, # The token&#x27;s string representation.
                &quot;tokenId&quot;: 42, # The token&#x27;s numerical ID. While the `token` field provides the string representation of the token, the `token_id` is the numerical representation that the model uses internally. This can be useful for developers who want to build custom logic based on the model&#x27;s vocabulary.
              },
            ],
          },
        ],
      },
      &quot;safetyRatings&quot;: [ # Output only. A list of ratings for the safety of a response candidate. There is at most one rating per category.
        { # A safety rating for a piece of content. The safety rating contains the harm category and the harm probability level.
          &quot;blocked&quot;: True or False, # Output only. Indicates whether the content was blocked because of this rating.
          &quot;category&quot;: &quot;A String&quot;, # Output only. The harm category of this rating.
          &quot;overwrittenThreshold&quot;: &quot;A String&quot;, # Output only. The overwritten threshold for the safety category of Gemini 2.0 image out. If minors are detected in the output image, the threshold of each safety category will be overwritten if user sets a lower threshold.
          &quot;probability&quot;: &quot;A String&quot;, # Output only. The probability of harm for this category.
          &quot;probabilityScore&quot;: 3.14, # Output only. The probability score of harm for this category.
          &quot;severity&quot;: &quot;A String&quot;, # Output only. The severity of harm for this category.
          &quot;severityScore&quot;: 3.14, # Output only. The severity score of harm for this category.
        },
      ],
      &quot;urlContextMetadata&quot;: { # Metadata returned when the model uses the `url_context` tool to get information from a user-provided URL. # Output only. Metadata returned when the model uses the `url_context` tool to get information from a user-provided URL.
        &quot;urlMetadata&quot;: [ # Output only. A list of URL metadata, with one entry for each URL retrieved by the tool.
          { # The metadata for a single URL retrieval.
            &quot;retrievedUrl&quot;: &quot;A String&quot;, # The URL retrieved by the tool.
            &quot;urlRetrievalStatus&quot;: &quot;A String&quot;, # The status of the URL retrieval.
          },
        ],
      },
    },
  ],
  &quot;createTime&quot;: &quot;A String&quot;, # Output only. Timestamp when the request is made to the server.
  &quot;modelVersion&quot;: &quot;A String&quot;, # Output only. The model version used to generate the response.
  &quot;promptFeedback&quot;: { # Content filter results for a prompt sent in the request. Note: This is sent only in the first stream chunk and only if no candidates were generated due to content violations. # Output only. Content filter results for a prompt sent in the request. Note: Sent only in the first stream chunk. Only happens when no candidates were generated due to content violations.
    &quot;blockReason&quot;: &quot;A String&quot;, # Output only. The reason why the prompt was blocked.
    &quot;blockReasonMessage&quot;: &quot;A String&quot;, # Output only. A readable message that explains the reason why the prompt was blocked.
    &quot;safetyRatings&quot;: [ # Output only. A list of safety ratings for the prompt. There is one rating per category.
      { # A safety rating for a piece of content. The safety rating contains the harm category and the harm probability level.
        &quot;blocked&quot;: True or False, # Output only. Indicates whether the content was blocked because of this rating.
        &quot;category&quot;: &quot;A String&quot;, # Output only. The harm category of this rating.
        &quot;overwrittenThreshold&quot;: &quot;A String&quot;, # Output only. The overwritten threshold for the safety category of Gemini 2.0 image out. If minors are detected in the output image, the threshold of each safety category will be overwritten if user sets a lower threshold.
        &quot;probability&quot;: &quot;A String&quot;, # Output only. The probability of harm for this category.
        &quot;probabilityScore&quot;: 3.14, # Output only. The probability score of harm for this category.
        &quot;severity&quot;: &quot;A String&quot;, # Output only. The severity of harm for this category.
        &quot;severityScore&quot;: 3.14, # Output only. The severity score of harm for this category.
      },
    ],
  },
  &quot;responseId&quot;: &quot;A String&quot;, # Output only. response_id is used to identify each response. It is the encoding of the event_id.
  &quot;usageMetadata&quot;: { # Usage metadata about the content generation request and response. This message provides a detailed breakdown of token usage and other relevant metrics. # Usage metadata about the response(s).
    &quot;cacheTokensDetails&quot;: [ # Output only. A detailed breakdown of the token count for each modality in the cached content.
      { # Represents a breakdown of token usage by modality. This message is used in CountTokensResponse and GenerateContentResponse.UsageMetadata to provide a detailed view of how many tokens are used by each modality (e.g., text, image, video) in a request. This is particularly useful for multimodal models, allowing you to track and manage token consumption for billing and quota purposes.
        &quot;modality&quot;: &quot;A String&quot;, # The modality that this token count applies to.
        &quot;tokenCount&quot;: 42, # The number of tokens counted for this modality.
      },
    ],
    &quot;cachedContentTokenCount&quot;: 42, # Output only. The number of tokens in the cached content that was used for this request.
    &quot;candidatesTokenCount&quot;: 42, # The total number of tokens in the generated candidates.
    &quot;candidatesTokensDetails&quot;: [ # Output only. A detailed breakdown of the token count for each modality in the generated candidates.
      { # Represents a breakdown of token usage by modality. This message is used in CountTokensResponse and GenerateContentResponse.UsageMetadata to provide a detailed view of how many tokens are used by each modality (e.g., text, image, video) in a request. This is particularly useful for multimodal models, allowing you to track and manage token consumption for billing and quota purposes.
        &quot;modality&quot;: &quot;A String&quot;, # The modality that this token count applies to.
        &quot;tokenCount&quot;: 42, # The number of tokens counted for this modality.
      },
    ],
    &quot;promptTokenCount&quot;: 42, # The total number of tokens in the prompt. This includes any text, images, or other media provided in the request. When `cached_content` is set, this also includes the number of tokens in the cached content.
    &quot;promptTokensDetails&quot;: [ # Output only. A detailed breakdown of the token count for each modality in the prompt.
      { # Represents a breakdown of token usage by modality. This message is used in CountTokensResponse and GenerateContentResponse.UsageMetadata to provide a detailed view of how many tokens are used by each modality (e.g., text, image, video) in a request. This is particularly useful for multimodal models, allowing you to track and manage token consumption for billing and quota purposes.
        &quot;modality&quot;: &quot;A String&quot;, # The modality that this token count applies to.
        &quot;tokenCount&quot;: 42, # The number of tokens counted for this modality.
      },
    ],
    &quot;thoughtsTokenCount&quot;: 42, # Output only. The number of tokens that were part of the model&#x27;s generated &quot;thoughts&quot; output, if applicable.
    &quot;toolUsePromptTokenCount&quot;: 42, # Output only. The number of tokens in the results from tool executions, which are provided back to the model as input, if applicable.
    &quot;toolUsePromptTokensDetails&quot;: [ # Output only. A detailed breakdown by modality of the token counts from the results of tool executions, which are provided back to the model as input.
      { # Represents a breakdown of token usage by modality. This message is used in CountTokensResponse and GenerateContentResponse.UsageMetadata to provide a detailed view of how many tokens are used by each modality (e.g., text, image, video) in a request. This is particularly useful for multimodal models, allowing you to track and manage token consumption for billing and quota purposes.
        &quot;modality&quot;: &quot;A String&quot;, # The modality that this token count applies to.
        &quot;tokenCount&quot;: 42, # The number of tokens counted for this modality.
      },
    ],
    &quot;totalTokenCount&quot;: 42, # The total number of tokens for the entire request. This is the sum of `prompt_token_count`, `candidates_token_count`, `tool_use_prompt_token_count`, and `thoughts_token_count`.
    &quot;trafficType&quot;: &quot;A String&quot;, # Output only. The traffic type for this request.
  },
}</pre>
</div>

<div class="method">
    <code class="details" id="predict">predict(endpoint, body=None, x__xgafv=None)</code>
  <pre>Perform an online prediction.

Args:
  endpoint: string, Required. The name of the Endpoint requested to serve the prediction. Format: `projects/{project}/locations/{location}/endpoints/{endpoint}` (required)
  body: object, The request body.
    The object takes the form of:

{ # Request message for PredictionService.Predict.
  &quot;instances&quot;: [ # Required. The instances that are the input to the prediction call. A DeployedModel may have an upper limit on the number of instances it supports per request, and when it is exceeded the prediction call errors in case of AutoML Models, or, in case of customer created Models, the behaviour is as documented by that Model. The schema of any single instance may be specified via Endpoint&#x27;s DeployedModels&#x27; Model&#x27;s PredictSchemata&#x27;s instance_schema_uri.
    &quot;&quot;,
  ],
  &quot;labels&quot;: { # Optional. The user labels for Imagen billing usage only. Only Imagen supports labels. For other use cases, it will be ignored.
    &quot;a_key&quot;: &quot;A String&quot;,
  },
  &quot;parameters&quot;: &quot;&quot;, # The parameters that govern the prediction. The schema of the parameters may be specified via Endpoint&#x27;s DeployedModels&#x27; Model&#x27;s PredictSchemata&#x27;s parameters_schema_uri.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Response message for PredictionService.Predict.
  &quot;deployedModelId&quot;: &quot;A String&quot;, # ID of the Endpoint&#x27;s DeployedModel that served this prediction.
  &quot;metadata&quot;: &quot;&quot;, # Output only. Request-level metadata returned by the model. The metadata type will be dependent upon the model implementation.
  &quot;model&quot;: &quot;A String&quot;, # Output only. The resource name of the Model which is deployed as the DeployedModel that this prediction hits.
  &quot;modelDisplayName&quot;: &quot;A String&quot;, # Output only. The display name of the Model which is deployed as the DeployedModel that this prediction hits.
  &quot;modelVersionId&quot;: &quot;A String&quot;, # Output only. The version ID of the Model which is deployed as the DeployedModel that this prediction hits.
  &quot;predictions&quot;: [ # The predictions that are the output of the predictions call. The schema of any single prediction may be specified via Endpoint&#x27;s DeployedModels&#x27; Model&#x27;s PredictSchemata&#x27;s prediction_schema_uri.
    &quot;&quot;,
  ],
}</pre>
</div>

<div class="method">
    <code class="details" id="predictLongRunning">predictLongRunning(endpoint, body=None, x__xgafv=None)</code>
  <pre>

Args:
  endpoint: string, Required. The name of the Endpoint requested to serve the prediction. Format: `projects/{project}/locations/{location}/endpoints/{endpoint}` or `projects/{project}/locations/{location}/publishers/{publisher}/models/{model}` (required)
  body: object, The request body.
    The object takes the form of:

{ # Request message for PredictionService.PredictLongRunning.
  &quot;instances&quot;: [ # Required. The instances that are the input to the prediction call. A DeployedModel may have an upper limit on the number of instances it supports per request, and when it is exceeded the prediction call errors in case of AutoML Models, or, in case of customer created Models, the behaviour is as documented by that Model. The schema of any single instance may be specified via Endpoint&#x27;s DeployedModels&#x27; Model&#x27;s PredictSchemata&#x27;s instance_schema_uri.
    &quot;&quot;,
  ],
  &quot;parameters&quot;: &quot;&quot;, # Optional. The parameters that govern the prediction. The schema of the parameters may be specified via Endpoint&#x27;s DeployedModels&#x27; Model&#x27;s PredictSchemata&#x27;s parameters_schema_uri.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # This resource represents a long-running operation that is the result of a network API call.
  &quot;done&quot;: True or False, # If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.
  &quot;error&quot;: { # The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors). # The error result of the operation in case of failure or cancellation.
    &quot;code&quot;: 42, # The status code, which should be an enum value of google.rpc.Code.
    &quot;details&quot;: [ # A list of messages that carry the error details. There is a common set of message types for APIs to use.
      {
        &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
      },
    ],
    &quot;message&quot;: &quot;A String&quot;, # A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
  },
  &quot;metadata&quot;: { # Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.
    &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
  },
  &quot;name&quot;: &quot;A String&quot;, # The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.
  &quot;response&quot;: { # The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.
    &quot;a_key&quot;: &quot;&quot;, # Properties of the object. Contains field @type with type URL.
  },
}</pre>
</div>

<div class="method">
    <code class="details" id="streamGenerateContent">streamGenerateContent(model, body=None, x__xgafv=None)</code>
  <pre>Generate content with multimodal inputs with streaming support.

Args:
  model: string, Required. The fully qualified name of the publisher model or tuned model endpoint to use. Publisher model format: `projects/{project}/locations/{location}/publishers/*/models/*` Tuned model endpoint format: `projects/{project}/locations/{location}/endpoints/{endpoint}` (required)
  body: object, The request body.
    The object takes the form of:

{ # Request message for [PredictionService.GenerateContent].
  &quot;cachedContent&quot;: &quot;A String&quot;, # Optional. The name of the cached content used as context to serve the prediction. Note: only used in explicit caching, where users can have control over caching (e.g. what content to cache) and enjoy guaranteed cost savings. Format: `projects/{project}/locations/{location}/cachedContents/{cachedContent}`
  &quot;contents&quot;: [ # Required. The content of the current conversation with the model. For single-turn queries, this is a single instance. For multi-turn queries, this is a repeated field that contains conversation history + latest request.
    { # The structured data content of a message. A Content message contains a `role` field, which indicates the producer of the content, and a `parts` field, which contains the multi-part data of the message.
      &quot;parts&quot;: [ # Required. A list of Part objects that make up a single message. Parts of a message can have different MIME types. A Content message must have at least one Part.
        { # A datatype containing media that is part of a multi-part Content message. A `Part` consists of data which has an associated datatype. A `Part` can only contain one of the accepted types in `Part.data`. For media types that are not text, `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if `inline_data` or `file_data` field is filled with raw bytes.
          &quot;codeExecutionResult&quot;: { # Result of executing the [ExecutableCode]. Only generated when using the [CodeExecution] tool, and always follows a `part` containing the [ExecutableCode]. # Optional. The result of executing the ExecutableCode.
            &quot;outcome&quot;: &quot;A String&quot;, # Required. Outcome of the code execution.
            &quot;output&quot;: &quot;A String&quot;, # Optional. Contains stdout when code execution is successful, stderr or other description otherwise.
          },
          &quot;executableCode&quot;: { # Code generated by the model that is meant to be executed, and the result returned to the model. Generated when using the [CodeExecution] tool, in which the code will be automatically executed, and a corresponding [CodeExecutionResult] will also be generated. # Optional. Code generated by the model that is intended to be executed.
            &quot;code&quot;: &quot;A String&quot;, # Required. The code to be executed.
            &quot;language&quot;: &quot;A String&quot;, # Required. Programming language of the `code`.
          },
          &quot;fileData&quot;: { # URI-based data. A FileData message contains a URI pointing to data of a specific media type. It is used to represent images, audio, and video stored in Google Cloud Storage. # Optional. The URI-based data of the part. This can be used to include files from Google Cloud Storage.
            &quot;displayName&quot;: &quot;A String&quot;, # Optional. The display name of the file. Used to provide a label or filename to distinguish files. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server side tools (`code_execution`, `google_search`, and `url_context`) are enabled.
            &quot;fileUri&quot;: &quot;A String&quot;, # Required. The URI of the file in Google Cloud Storage.
            &quot;mimeType&quot;: &quot;A String&quot;, # Required. The IANA standard MIME type of the source data.
          },
          &quot;functionCall&quot;: { # A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing the parameters and their values. # Optional. A predicted function call returned from the model. This contains the name of the function to call and the arguments to pass to the function.
            &quot;args&quot;: { # Optional. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.
              &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
            },
            &quot;name&quot;: &quot;A String&quot;, # Optional. The name of the function to call. Matches [FunctionDeclaration.name].
          },
          &quot;functionResponse&quot;: { # The result output from a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a [FunctionCall] made based on model prediction. # Optional. The result of a function call. This is used to provide the model with the result of a function call that it predicted.
            &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].
            &quot;parts&quot;: [ # Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types.
              { # A datatype containing media that is part of a `FunctionResponse` message. A `FunctionResponsePart` consists of data which has an associated datatype. A `FunctionResponsePart` can only contain one of the accepted types in `FunctionResponsePart.data`. A `FunctionResponsePart` must have a fixed IANA MIME type identifying the type and subtype of the media if the `inline_data` field is filled with raw bytes.
                &quot;fileData&quot;: { # URI based data for function response. # URI based data.
                  &quot;displayName&quot;: &quot;A String&quot;, # Optional. Display name of the file data. Used to provide a label or filename to distinguish file datas. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled.
                  &quot;fileUri&quot;: &quot;A String&quot;, # Required. URI.
                  &quot;mimeType&quot;: &quot;A String&quot;, # Required. The IANA standard MIME type of the source data.
                },
                &quot;inlineData&quot;: { # Raw media bytes for function response. Text should not be sent as raw bytes, use the &#x27;text&#x27; field. # Inline media bytes.
                  &quot;data&quot;: &quot;A String&quot;, # Required. Raw bytes.
                  &quot;displayName&quot;: &quot;A String&quot;, # Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled.
                  &quot;mimeType&quot;: &quot;A String&quot;, # Required. The IANA standard MIME type of the source data.
                },
              },
            ],
            &quot;response&quot;: { # Required. The function response in JSON object format. Use &quot;output&quot; key to specify function output and &quot;error&quot; key to specify error details (if any). If &quot;output&quot; and &quot;error&quot; keys are not specified, then whole &quot;response&quot; is treated as function output.
              &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
            },
          },
          &quot;inlineData&quot;: { # A content blob. A Blob contains data of a specific media type. It is used to represent images, audio, and video. # Optional. The inline data content of the part. This can be used to include images, audio, or video in a request.
            &quot;data&quot;: &quot;A String&quot;, # Required. The raw bytes of the data.
            &quot;displayName&quot;: &quot;A String&quot;, # Optional. The display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server-side tools (`code_execution`, `google_search`, and `url_context`) are enabled.
            &quot;mimeType&quot;: &quot;A String&quot;, # Required. The IANA standard MIME type of the source data.
          },
          &quot;text&quot;: &quot;A String&quot;, # Optional. The text content of the part.
          &quot;thought&quot;: True or False, # Optional. Indicates whether the `part` represents the model&#x27;s thought process or reasoning.
          &quot;thoughtSignature&quot;: &quot;A String&quot;, # Optional. An opaque signature for the thought so it can be reused in subsequent requests.
          &quot;videoMetadata&quot;: { # Provides metadata for a video, including the start and end offsets for clipping and the frame rate. # Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.
            &quot;endOffset&quot;: &quot;A String&quot;, # Optional. The end offset of the video.
            &quot;fps&quot;: 3.14, # Optional. The frame rate of the video sent to the model. If not specified, the default value is 1.0. The valid range is (0.0, 24.0].
            &quot;startOffset&quot;: &quot;A String&quot;, # Optional. The start offset of the video.
          },
        },
      ],
      &quot;role&quot;: &quot;A String&quot;, # Optional. The producer of the content. Must be either &#x27;user&#x27; or &#x27;model&#x27;. If not set, the service will default to &#x27;user&#x27;.
    },
  ],
  &quot;generationConfig&quot;: { # Configuration for content generation. This message contains all the parameters that control how the model generates content. It allows you to influence the randomness, length, and structure of the output. # Optional. Generation config.
    &quot;audioTimestamp&quot;: True or False, # Optional. If enabled, audio timestamps will be included in the request to the model. This can be useful for synchronizing audio with other modalities in the response.
    &quot;candidateCount&quot;: 42, # Optional. The number of candidate responses to generate. A higher `candidate_count` can provide more options to choose from, but it also consumes more resources. This can be useful for generating a variety of responses and selecting the best one.
    &quot;enableAffectiveDialog&quot;: True or False, # Optional. If enabled, the model will detect emotions and adapt its responses accordingly. For example, if the model detects that the user is frustrated, it may provide a more empathetic response.
    &quot;frequencyPenalty&quot;: 3.14, # Optional. Penalizes tokens based on their frequency in the generated text. A positive value helps to reduce the repetition of words and phrases. Valid values can range from [-2.0, 2.0].
    &quot;imageConfig&quot;: { # Configuration for image generation. This message allows you to control various aspects of image generation, such as the output format, aspect ratio, and whether the model can generate images of people. # Optional. Config for image generation features.
      &quot;aspectRatio&quot;: &quot;A String&quot;, # Optional. The desired aspect ratio for the generated images. The following aspect ratios are supported: &quot;1:1&quot; &quot;2:3&quot;, &quot;3:2&quot; &quot;3:4&quot;, &quot;4:3&quot; &quot;4:5&quot;, &quot;5:4&quot; &quot;9:16&quot;, &quot;16:9&quot; &quot;21:9&quot;
      &quot;imageOutputOptions&quot;: { # The image output format for generated images. # Optional. The image output format for generated images.
        &quot;compressionQuality&quot;: 42, # Optional. The compression quality of the output image.
        &quot;mimeType&quot;: &quot;A String&quot;, # Optional. The image format that the output should be saved as.
      },
      &quot;personGeneration&quot;: &quot;A String&quot;, # Optional. Controls whether the model can generate people.
    },
    &quot;logprobs&quot;: 42, # Optional. The number of top log probabilities to return for each token. This can be used to see which other tokens were considered likely candidates for a given position. A higher value will return more options, but it will also increase the size of the response.
    &quot;maxOutputTokens&quot;: 42, # Optional. The maximum number of tokens to generate in the response. A token is approximately four characters. The default value varies by model. This parameter can be used to control the length of the generated text and prevent overly long responses.
    &quot;mediaResolution&quot;: &quot;A String&quot;, # Optional. The token resolution at which input media content is sampled. This is used to control the trade-off between the quality of the response and the number of tokens used to represent the media. A higher resolution allows the model to perceive more detail, which can lead to a more nuanced response, but it will also use more tokens. This does not affect the image dimensions sent to the model.
    &quot;presencePenalty&quot;: 3.14, # Optional. Penalizes tokens that have already appeared in the generated text. A positive value encourages the model to generate more diverse and less repetitive text. Valid values can range from [-2.0, 2.0].
    &quot;responseJsonSchema&quot;: &quot;&quot;, # Optional. When this field is set, response_schema must be omitted and response_mime_type must be set to `application/json`.
    &quot;responseLogprobs&quot;: True or False, # Optional. If set to true, the log probabilities of the output tokens are returned. Log probabilities are the logarithm of the probability of a token appearing in the output. A higher log probability means the token is more likely to be generated. This can be useful for analyzing the model&#x27;s confidence in its own output and for debugging.
    &quot;responseMimeType&quot;: &quot;A String&quot;, # Optional. The IANA standard MIME type of the response. The model will generate output that conforms to this MIME type. Supported values include &#x27;text/plain&#x27; (default) and &#x27;application/json&#x27;. The model needs to be prompted to output the appropriate response type, otherwise the behavior is undefined. This is a preview feature.
    &quot;responseModalities&quot;: [ # Optional. The modalities of the response. The model will generate a response that includes all the specified modalities. For example, if this is set to `[TEXT, IMAGE]`, the response will include both text and an image.
      &quot;A String&quot;,
    ],
    &quot;responseSchema&quot;: { # Schema is used to define the format of input/output data. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may be added in the future as needed. # Optional. Lets you to specify a schema for the model&#x27;s response, ensuring that the output conforms to a particular structure. This is useful for generating structured data such as JSON. The schema is a subset of the [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema) object. When this field is set, you must also set the `response_mime_type` to `application/json`.
      &quot;additionalProperties&quot;: &quot;&quot;, # Optional. Can either be a boolean or an object; controls the presence of additional properties.
      &quot;anyOf&quot;: [ # Optional. The value should be validated against any (one or more) of the subschemas in the list.
        # Object with schema name: GoogleCloudAiplatformV1Schema
      ],
      &quot;default&quot;: &quot;&quot;, # Optional. Default value of the data.
      &quot;defs&quot;: { # Optional. A map of definitions for use by `ref` Only allowed at the root of the schema.
        &quot;a_key&quot;: # Object with schema name: GoogleCloudAiplatformV1Schema
      },
      &quot;description&quot;: &quot;A String&quot;, # Optional. The description of the data.
      &quot;enum&quot;: [ # Optional. Possible values of the element of primitive type with enum format. Examples: 1. We can define direction as : {type:STRING, format:enum, enum:[&quot;EAST&quot;, NORTH&quot;, &quot;SOUTH&quot;, &quot;WEST&quot;]} 2. We can define apartment number as : {type:INTEGER, format:enum, enum:[&quot;101&quot;, &quot;201&quot;, &quot;301&quot;]}
        &quot;A String&quot;,
      ],
      &quot;example&quot;: &quot;&quot;, # Optional. Example of the object. Will only populated when the object is the root.
      &quot;format&quot;: &quot;A String&quot;, # Optional. The format of the data. Supported formats: for NUMBER type: &quot;float&quot;, &quot;double&quot; for INTEGER type: &quot;int32&quot;, &quot;int64&quot; for STRING type: &quot;email&quot;, &quot;byte&quot;, etc
      &quot;items&quot;: # Object with schema name: GoogleCloudAiplatformV1Schema # Optional. SCHEMA FIELDS FOR TYPE ARRAY Schema of the elements of Type.ARRAY.
      &quot;maxItems&quot;: &quot;A String&quot;, # Optional. Maximum number of the elements for Type.ARRAY.
      &quot;maxLength&quot;: &quot;A String&quot;, # Optional. Maximum length of the Type.STRING
      &quot;maxProperties&quot;: &quot;A String&quot;, # Optional. Maximum number of the properties for Type.OBJECT.
      &quot;maximum&quot;: 3.14, # Optional. Maximum value of the Type.INTEGER and Type.NUMBER
      &quot;minItems&quot;: &quot;A String&quot;, # Optional. Minimum number of the elements for Type.ARRAY.
      &quot;minLength&quot;: &quot;A String&quot;, # Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING
      &quot;minProperties&quot;: &quot;A String&quot;, # Optional. Minimum number of the properties for Type.OBJECT.
      &quot;minimum&quot;: 3.14, # Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER
      &quot;nullable&quot;: True or False, # Optional. Indicates if the value may be null.
      &quot;pattern&quot;: &quot;A String&quot;, # Optional. Pattern of the Type.STRING to restrict a string to a regular expression.
      &quot;properties&quot;: { # Optional. SCHEMA FIELDS FOR TYPE OBJECT Properties of Type.OBJECT.
        &quot;a_key&quot;: # Object with schema name: GoogleCloudAiplatformV1Schema
      },
      &quot;propertyOrdering&quot;: [ # Optional. The order of the properties. Not a standard field in open api spec. Only used to support the order of the properties.
        &quot;A String&quot;,
      ],
      &quot;ref&quot;: &quot;A String&quot;, # Optional. Allows indirect references between schema nodes. The value should be a valid reference to a child of the root `defs`. For example, the following schema defines a reference to a schema node named &quot;Pet&quot;: type: object properties: pet: ref: #/defs/Pet defs: Pet: type: object properties: name: type: string The value of the &quot;pet&quot; property is a reference to the schema node named &quot;Pet&quot;. See details in https://json-schema.org/understanding-json-schema/structuring
      &quot;required&quot;: [ # Optional. Required properties of Type.OBJECT.
        &quot;A String&quot;,
      ],
      &quot;title&quot;: &quot;A String&quot;, # Optional. The title of the Schema.
      &quot;type&quot;: &quot;A String&quot;, # Optional. The type of the data.
    },
    &quot;routingConfig&quot;: { # The configuration for routing the request to a specific model. This can be used to control which model is used for the generation, either automatically or by specifying a model name. # Optional. Routing configuration.
      &quot;autoMode&quot;: { # The configuration for automated routing. When automated routing is specified, the routing will be determined by the pretrained routing model and customer provided model routing preference. # In this mode, the model is selected automatically based on the content of the request.
        &quot;modelRoutingPreference&quot;: &quot;A String&quot;, # The model routing preference.
      },
      &quot;manualMode&quot;: { # The configuration for manual routing. When manual routing is specified, the model will be selected based on the model name provided. # In this mode, the model is specified manually.
        &quot;modelName&quot;: &quot;A String&quot;, # The name of the model to use. Only public LLM models are accepted.
      },
    },
    &quot;seed&quot;: 42, # Optional. A seed for the random number generator. By setting a seed, you can make the model&#x27;s output mostly deterministic. For a given prompt and parameters (like temperature, top_p, etc.), the model will produce the same response every time. However, it&#x27;s not a guaranteed absolute deterministic behavior. This is different from parameters like `temperature`, which control the *level* of randomness. `seed` ensures that the &quot;random&quot; choices the model makes are the same on every run, making it essential for testing and ensuring reproducible results.
    &quot;speechConfig&quot;: { # Configuration for speech generation. # Optional. The speech generation config.
      &quot;languageCode&quot;: &quot;A String&quot;, # Optional. The language code (ISO 639-1) for the speech synthesis.
      &quot;multiSpeakerVoiceConfig&quot;: { # Configuration for a multi-speaker text-to-speech request. # The configuration for a multi-speaker text-to-speech request. This field is mutually exclusive with `voice_config`.
        &quot;speakerVoiceConfigs&quot;: [ # Required. A list of configurations for the voices of the speakers. Exactly two speaker voice configurations must be provided.
          { # Configuration for a single speaker in a multi-speaker setup.
            &quot;speaker&quot;: &quot;A String&quot;, # Required. The name of the speaker. This should be the same as the speaker name used in the prompt.
            &quot;voiceConfig&quot;: { # Configuration for a voice. # Required. The configuration for the voice of this speaker.
              &quot;prebuiltVoiceConfig&quot;: { # Configuration for a prebuilt voice. # The configuration for a prebuilt voice.
                &quot;voiceName&quot;: &quot;A String&quot;, # The name of the prebuilt voice to use.
              },
            },
          },
        ],
      },
      &quot;voiceConfig&quot;: { # Configuration for a voice. # The configuration for the voice to use.
        &quot;prebuiltVoiceConfig&quot;: { # Configuration for a prebuilt voice. # The configuration for a prebuilt voice.
          &quot;voiceName&quot;: &quot;A String&quot;, # The name of the prebuilt voice to use.
        },
      },
    },
    &quot;stopSequences&quot;: [ # Optional. A list of character sequences that will stop the model from generating further tokens. If a stop sequence is generated, the output will end at that point. This is useful for controlling the length and structure of the output. For example, you can use [&quot;\n&quot;, &quot;###&quot;] to stop generation at a new line or a specific marker.
      &quot;A String&quot;,
    ],
    &quot;temperature&quot;: 3.14, # Optional. Controls the randomness of the output. A higher temperature results in more creative and diverse responses, while a lower temperature makes the output more predictable and focused. The valid range is (0.0, 2.0].
    &quot;thinkingConfig&quot;: { # Configuration for the model&#x27;s thinking features. &quot;Thinking&quot; is a process where the model breaks down a complex task into smaller, manageable steps. This allows the model to reason about the task, plan its approach, and execute the plan to generate a high-quality response. # Optional. Configuration for thinking features. An error will be returned if this field is set for models that don&#x27;t support thinking.
      &quot;includeThoughts&quot;: True or False, # Optional. If true, the model will include its thoughts in the response. &quot;Thoughts&quot; are the intermediate steps the model takes to arrive at the final response. They can provide insights into the model&#x27;s reasoning process and help with debugging. If this is true, thoughts are returned only when available.
      &quot;thinkingBudget&quot;: 42, # Optional. The token budget for the model&#x27;s thinking process. The model will make a best effort to stay within this budget. This can be used to control the trade-off between response quality and latency.
    },
    &quot;topK&quot;: 3.14, # Optional. Specifies the top-k sampling threshold. The model considers only the top k most probable tokens for the next token. This can be useful for generating more coherent and less random text. For example, a `top_k` of 40 means the model will choose the next word from the 40 most likely words.
    &quot;topP&quot;: 3.14, # Optional. Specifies the nucleus sampling threshold. The model considers only the smallest set of tokens whose cumulative probability is at least `top_p`. This helps generate more diverse and less repetitive responses. For example, a `top_p` of 0.9 means the model considers tokens until the cumulative probability of the tokens to select from reaches 0.9. It&#x27;s recommended to adjust either temperature or `top_p`, but not both.
  },
  &quot;labels&quot;: { # Optional. The labels with user-defined metadata for the request. It is used for billing and reporting only. Label keys and values can be no longer than 63 characters (Unicode codepoints) and can only contain lowercase letters, numeric characters, underscores, and dashes. International characters are allowed. Label values are optional. Label keys must start with a letter.
    &quot;a_key&quot;: &quot;A String&quot;,
  },
  &quot;modelArmorConfig&quot;: { # Configuration for Model Armor. Model Armor is a Google Cloud service that provides safety and security filtering for prompts and responses. It helps protect your AI applications from risks such as harmful content, sensitive data leakage, and prompt injection attacks. # Optional. Settings for prompt and response sanitization using the Model Armor service. If supplied, safety_settings must not be supplied.
    &quot;promptTemplateName&quot;: &quot;A String&quot;, # Optional. The resource name of the Model Armor template to use for prompt screening. A Model Armor template is a set of customized filters and thresholds that define how Model Armor screens content. If specified, Model Armor will use this template to check the user&#x27;s prompt for safety and security risks before it is sent to the model. The name must be in the format `projects/{project}/locations/{location}/templates/{template}`.
    &quot;responseTemplateName&quot;: &quot;A String&quot;, # Optional. The resource name of the Model Armor template to use for response screening. A Model Armor template is a set of customized filters and thresholds that define how Model Armor screens content. If specified, Model Armor will use this template to check the model&#x27;s response for safety and security risks before it is returned to the user. The name must be in the format `projects/{project}/locations/{location}/templates/{template}`.
  },
  &quot;safetySettings&quot;: [ # Optional. Per request settings for blocking unsafe content. Enforced on GenerateContentResponse.candidates.
    { # A safety setting that affects the safety-blocking behavior. A SafetySetting consists of a harm category and a threshold for that category.
      &quot;category&quot;: &quot;A String&quot;, # Required. The harm category to be blocked.
      &quot;method&quot;: &quot;A String&quot;, # Optional. The method for blocking content. If not specified, the default behavior is to use the probability score.
      &quot;threshold&quot;: &quot;A String&quot;, # Required. The threshold for blocking content. If the harm probability exceeds this threshold, the content will be blocked.
    },
  ],
  &quot;systemInstruction&quot;: { # The structured data content of a message. A Content message contains a `role` field, which indicates the producer of the content, and a `parts` field, which contains the multi-part data of the message. # Optional. The user provided system instructions for the model. Note: only text should be used in parts and content in each part will be in a separate paragraph.
    &quot;parts&quot;: [ # Required. A list of Part objects that make up a single message. Parts of a message can have different MIME types. A Content message must have at least one Part.
      { # A datatype containing media that is part of a multi-part Content message. A `Part` consists of data which has an associated datatype. A `Part` can only contain one of the accepted types in `Part.data`. For media types that are not text, `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if `inline_data` or `file_data` field is filled with raw bytes.
        &quot;codeExecutionResult&quot;: { # Result of executing the [ExecutableCode]. Only generated when using the [CodeExecution] tool, and always follows a `part` containing the [ExecutableCode]. # Optional. The result of executing the ExecutableCode.
          &quot;outcome&quot;: &quot;A String&quot;, # Required. Outcome of the code execution.
          &quot;output&quot;: &quot;A String&quot;, # Optional. Contains stdout when code execution is successful, stderr or other description otherwise.
        },
        &quot;executableCode&quot;: { # Code generated by the model that is meant to be executed, and the result returned to the model. Generated when using the [CodeExecution] tool, in which the code will be automatically executed, and a corresponding [CodeExecutionResult] will also be generated. # Optional. Code generated by the model that is intended to be executed.
          &quot;code&quot;: &quot;A String&quot;, # Required. The code to be executed.
          &quot;language&quot;: &quot;A String&quot;, # Required. Programming language of the `code`.
        },
        &quot;fileData&quot;: { # URI-based data. A FileData message contains a URI pointing to data of a specific media type. It is used to represent images, audio, and video stored in Google Cloud Storage. # Optional. The URI-based data of the part. This can be used to include files from Google Cloud Storage.
          &quot;displayName&quot;: &quot;A String&quot;, # Optional. The display name of the file. Used to provide a label or filename to distinguish files. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server side tools (`code_execution`, `google_search`, and `url_context`) are enabled.
          &quot;fileUri&quot;: &quot;A String&quot;, # Required. The URI of the file in Google Cloud Storage.
          &quot;mimeType&quot;: &quot;A String&quot;, # Required. The IANA standard MIME type of the source data.
        },
        &quot;functionCall&quot;: { # A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing the parameters and their values. # Optional. A predicted function call returned from the model. This contains the name of the function to call and the arguments to pass to the function.
          &quot;args&quot;: { # Optional. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.
            &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
          },
          &quot;name&quot;: &quot;A String&quot;, # Optional. The name of the function to call. Matches [FunctionDeclaration.name].
        },
        &quot;functionResponse&quot;: { # The result output from a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a [FunctionCall] made based on model prediction. # Optional. The result of a function call. This is used to provide the model with the result of a function call that it predicted.
          &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].
          &quot;parts&quot;: [ # Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types.
            { # A datatype containing media that is part of a `FunctionResponse` message. A `FunctionResponsePart` consists of data which has an associated datatype. A `FunctionResponsePart` can only contain one of the accepted types in `FunctionResponsePart.data`. A `FunctionResponsePart` must have a fixed IANA MIME type identifying the type and subtype of the media if the `inline_data` field is filled with raw bytes.
              &quot;fileData&quot;: { # URI based data for function response. # URI based data.
                &quot;displayName&quot;: &quot;A String&quot;, # Optional. Display name of the file data. Used to provide a label or filename to distinguish file datas. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled.
                &quot;fileUri&quot;: &quot;A String&quot;, # Required. URI.
                &quot;mimeType&quot;: &quot;A String&quot;, # Required. The IANA standard MIME type of the source data.
              },
              &quot;inlineData&quot;: { # Raw media bytes for function response. Text should not be sent as raw bytes, use the &#x27;text&#x27; field. # Inline media bytes.
                &quot;data&quot;: &quot;A String&quot;, # Required. Raw bytes.
                &quot;displayName&quot;: &quot;A String&quot;, # Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled.
                &quot;mimeType&quot;: &quot;A String&quot;, # Required. The IANA standard MIME type of the source data.
              },
            },
          ],
          &quot;response&quot;: { # Required. The function response in JSON object format. Use &quot;output&quot; key to specify function output and &quot;error&quot; key to specify error details (if any). If &quot;output&quot; and &quot;error&quot; keys are not specified, then whole &quot;response&quot; is treated as function output.
            &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
          },
        },
        &quot;inlineData&quot;: { # A content blob. A Blob contains data of a specific media type. It is used to represent images, audio, and video. # Optional. The inline data content of the part. This can be used to include images, audio, or video in a request.
          &quot;data&quot;: &quot;A String&quot;, # Required. The raw bytes of the data.
          &quot;displayName&quot;: &quot;A String&quot;, # Optional. The display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server-side tools (`code_execution`, `google_search`, and `url_context`) are enabled.
          &quot;mimeType&quot;: &quot;A String&quot;, # Required. The IANA standard MIME type of the source data.
        },
        &quot;text&quot;: &quot;A String&quot;, # Optional. The text content of the part.
        &quot;thought&quot;: True or False, # Optional. Indicates whether the `part` represents the model&#x27;s thought process or reasoning.
        &quot;thoughtSignature&quot;: &quot;A String&quot;, # Optional. An opaque signature for the thought so it can be reused in subsequent requests.
        &quot;videoMetadata&quot;: { # Provides metadata for a video, including the start and end offsets for clipping and the frame rate. # Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.
          &quot;endOffset&quot;: &quot;A String&quot;, # Optional. The end offset of the video.
          &quot;fps&quot;: 3.14, # Optional. The frame rate of the video sent to the model. If not specified, the default value is 1.0. The valid range is (0.0, 24.0].
          &quot;startOffset&quot;: &quot;A String&quot;, # Optional. The start offset of the video.
        },
      },
    ],
    &quot;role&quot;: &quot;A String&quot;, # Optional. The producer of the content. Must be either &#x27;user&#x27; or &#x27;model&#x27;. If not set, the service will default to &#x27;user&#x27;.
  },
  &quot;toolConfig&quot;: { # Tool config. This config is shared for all tools provided in the request. # Optional. Tool config. This config is shared for all tools provided in the request.
    &quot;functionCallingConfig&quot;: { # Function calling config. # Optional. Function calling config.
      &quot;allowedFunctionNames&quot;: [ # Optional. Function names to call. Only set when the Mode is ANY. Function names should match [FunctionDeclaration.name]. With mode set to ANY, model will predict a function call from the set of function names provided.
        &quot;A String&quot;,
      ],
      &quot;mode&quot;: &quot;A String&quot;, # Optional. Function calling mode.
    },
    &quot;retrievalConfig&quot;: { # Retrieval config. # Optional. Retrieval config.
      &quot;languageCode&quot;: &quot;A String&quot;, # The language code of the user.
      &quot;latLng&quot;: { # An object that represents a latitude/longitude pair. This is expressed as a pair of doubles to represent degrees latitude and degrees longitude. Unless specified otherwise, this object must conform to the WGS84 standard. Values must be within normalized ranges. # The location of the user.
        &quot;latitude&quot;: 3.14, # The latitude in degrees. It must be in the range [-90.0, +90.0].
        &quot;longitude&quot;: 3.14, # The longitude in degrees. It must be in the range [-180.0, +180.0].
      },
    },
  },
  &quot;tools&quot;: [ # Optional. A list of `Tools` the model may use to generate the next response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model.
    { # Tool details that the model may use to generate response. A `Tool` is a piece of code that enables the system to interact with external systems to perform an action, or set of actions, outside of knowledge and scope of the model. A Tool object should contain exactly one type of Tool (e.g FunctionDeclaration, Retrieval or GoogleSearchRetrieval).
      &quot;codeExecution&quot;: { # Tool that executes code generated by the model, and automatically returns the result to the model. See also [ExecutableCode]and [CodeExecutionResult] which are input and output to this tool. # Optional. CodeExecution tool type. Enables the model to execute code as part of generation.
      },
      &quot;computerUse&quot;: { # Tool to support computer use. # Optional. Tool to support the model interacting directly with the computer. If enabled, it automatically populates computer-use specific Function Declarations.
        &quot;environment&quot;: &quot;A String&quot;, # Required. The environment being operated.
        &quot;excludedPredefinedFunctions&quot;: [ # Optional. By default, [predefined functions](https://cloud.google.com/vertex-ai/generative-ai/docs/computer-use#supported-actions) are included in the final model call. Some of them can be explicitly excluded from being automatically included. This can serve two purposes: 1. Using a more restricted / different action space. 2. Improving the definitions / instructions of predefined functions.
          &quot;A String&quot;,
        ],
      },
      &quot;enterpriseWebSearch&quot;: { # Tool to search public web data, powered by Vertex AI Search and Sec4 compliance. # Optional. Tool to support searching public web data, powered by Vertex AI Search and Sec4 compliance.
        &quot;blockingConfidence&quot;: &quot;A String&quot;, # Optional. Sites with confidence level chosen &amp; above this value will be blocked from the search results.
        &quot;excludeDomains&quot;: [ # Optional. List of domains to be excluded from the search results. The default limit is 2000 domains.
          &quot;A String&quot;,
        ],
      },
      &quot;functionDeclarations&quot;: [ # Optional. Function tool type. One or more function declarations to be passed to the model along with the current user query. Model may decide to call a subset of these functions by populating FunctionCall in the response. User should provide a FunctionResponse for each function call in the next turn. Based on the function responses, Model will generate the final response back to the user. Maximum 512 function declarations can be provided.
        { # Structured representation of a function declaration as defined by the [OpenAPI 3.0 specification](https://spec.openapis.org/oas/v3.0.3). Included in this declaration are the function name, description, parameters and response type. This FunctionDeclaration is a representation of a block of code that can be used as a `Tool` by the model and executed by the client.
          &quot;description&quot;: &quot;A String&quot;, # Optional. Description and purpose of the function. Model uses it to decide how and whether to call the function.
          &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to call. Must start with a letter or an underscore. Must be a-z, A-Z, 0-9, or contain underscores, dots and dashes, with a maximum length of 64.
          &quot;parameters&quot;: { # Schema is used to define the format of input/output data. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may be added in the future as needed. # Optional. Describes the parameters to this function in JSON Schema Object format. Reflects the Open API 3.03 Parameter Object. string Key: the name of the parameter. Parameter names are case sensitive. Schema Value: the Schema defining the type used for the parameter. For function with no parameters, this can be left unset. Parameter names must start with a letter or an underscore and must only contain chars a-z, A-Z, 0-9, or underscores with a maximum length of 64. Example with 1 required and 1 optional parameter: type: OBJECT properties: param1: type: STRING param2: type: INTEGER required: - param1
            &quot;additionalProperties&quot;: &quot;&quot;, # Optional. Can either be a boolean or an object; controls the presence of additional properties.
            &quot;anyOf&quot;: [ # Optional. The value should be validated against any (one or more) of the subschemas in the list.
              # Object with schema name: GoogleCloudAiplatformV1Schema
            ],
            &quot;default&quot;: &quot;&quot;, # Optional. Default value of the data.
            &quot;defs&quot;: { # Optional. A map of definitions for use by `ref` Only allowed at the root of the schema.
              &quot;a_key&quot;: # Object with schema name: GoogleCloudAiplatformV1Schema
            },
            &quot;description&quot;: &quot;A String&quot;, # Optional. The description of the data.
            &quot;enum&quot;: [ # Optional. Possible values of the element of primitive type with enum format. Examples: 1. We can define direction as : {type:STRING, format:enum, enum:[&quot;EAST&quot;, NORTH&quot;, &quot;SOUTH&quot;, &quot;WEST&quot;]} 2. We can define apartment number as : {type:INTEGER, format:enum, enum:[&quot;101&quot;, &quot;201&quot;, &quot;301&quot;]}
              &quot;A String&quot;,
            ],
            &quot;example&quot;: &quot;&quot;, # Optional. Example of the object. Will only populated when the object is the root.
            &quot;format&quot;: &quot;A String&quot;, # Optional. The format of the data. Supported formats: for NUMBER type: &quot;float&quot;, &quot;double&quot; for INTEGER type: &quot;int32&quot;, &quot;int64&quot; for STRING type: &quot;email&quot;, &quot;byte&quot;, etc
            &quot;items&quot;: # Object with schema name: GoogleCloudAiplatformV1Schema # Optional. SCHEMA FIELDS FOR TYPE ARRAY Schema of the elements of Type.ARRAY.
            &quot;maxItems&quot;: &quot;A String&quot;, # Optional. Maximum number of the elements for Type.ARRAY.
            &quot;maxLength&quot;: &quot;A String&quot;, # Optional. Maximum length of the Type.STRING
            &quot;maxProperties&quot;: &quot;A String&quot;, # Optional. Maximum number of the properties for Type.OBJECT.
            &quot;maximum&quot;: 3.14, # Optional. Maximum value of the Type.INTEGER and Type.NUMBER
            &quot;minItems&quot;: &quot;A String&quot;, # Optional. Minimum number of the elements for Type.ARRAY.
            &quot;minLength&quot;: &quot;A String&quot;, # Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING
            &quot;minProperties&quot;: &quot;A String&quot;, # Optional. Minimum number of the properties for Type.OBJECT.
            &quot;minimum&quot;: 3.14, # Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER
            &quot;nullable&quot;: True or False, # Optional. Indicates if the value may be null.
            &quot;pattern&quot;: &quot;A String&quot;, # Optional. Pattern of the Type.STRING to restrict a string to a regular expression.
            &quot;properties&quot;: { # Optional. SCHEMA FIELDS FOR TYPE OBJECT Properties of Type.OBJECT.
              &quot;a_key&quot;: # Object with schema name: GoogleCloudAiplatformV1Schema
            },
            &quot;propertyOrdering&quot;: [ # Optional. The order of the properties. Not a standard field in open api spec. Only used to support the order of the properties.
              &quot;A String&quot;,
            ],
            &quot;ref&quot;: &quot;A String&quot;, # Optional. Allows indirect references between schema nodes. The value should be a valid reference to a child of the root `defs`. For example, the following schema defines a reference to a schema node named &quot;Pet&quot;: type: object properties: pet: ref: #/defs/Pet defs: Pet: type: object properties: name: type: string The value of the &quot;pet&quot; property is a reference to the schema node named &quot;Pet&quot;. See details in https://json-schema.org/understanding-json-schema/structuring
            &quot;required&quot;: [ # Optional. Required properties of Type.OBJECT.
              &quot;A String&quot;,
            ],
            &quot;title&quot;: &quot;A String&quot;, # Optional. The title of the Schema.
            &quot;type&quot;: &quot;A String&quot;, # Optional. The type of the data.
          },
          &quot;parametersJsonSchema&quot;: &quot;&quot;, # Optional. Describes the parameters to the function in JSON Schema format. The schema must describe an object where the properties are the parameters to the function. For example: ``` { &quot;type&quot;: &quot;object&quot;, &quot;properties&quot;: { &quot;name&quot;: { &quot;type&quot;: &quot;string&quot; }, &quot;age&quot;: { &quot;type&quot;: &quot;integer&quot; } }, &quot;additionalProperties&quot;: false, &quot;required&quot;: [&quot;name&quot;, &quot;age&quot;], &quot;propertyOrdering&quot;: [&quot;name&quot;, &quot;age&quot;] } ``` This field is mutually exclusive with `parameters`.
          &quot;response&quot;: { # Schema is used to define the format of input/output data. Represents a select subset of an [OpenAPI 3.0 schema object](https://spec.openapis.org/oas/v3.0.3#schema-object). More fields may be added in the future as needed. # Optional. Describes the output from this function in JSON Schema format. Reflects the Open API 3.03 Response Object. The Schema defines the type used for the response value of the function.
            &quot;additionalProperties&quot;: &quot;&quot;, # Optional. Can either be a boolean or an object; controls the presence of additional properties.
            &quot;anyOf&quot;: [ # Optional. The value should be validated against any (one or more) of the subschemas in the list.
              # Object with schema name: GoogleCloudAiplatformV1Schema
            ],
            &quot;default&quot;: &quot;&quot;, # Optional. Default value of the data.
            &quot;defs&quot;: { # Optional. A map of definitions for use by `ref` Only allowed at the root of the schema.
              &quot;a_key&quot;: # Object with schema name: GoogleCloudAiplatformV1Schema
            },
            &quot;description&quot;: &quot;A String&quot;, # Optional. The description of the data.
            &quot;enum&quot;: [ # Optional. Possible values of the element of primitive type with enum format. Examples: 1. We can define direction as : {type:STRING, format:enum, enum:[&quot;EAST&quot;, NORTH&quot;, &quot;SOUTH&quot;, &quot;WEST&quot;]} 2. We can define apartment number as : {type:INTEGER, format:enum, enum:[&quot;101&quot;, &quot;201&quot;, &quot;301&quot;]}
              &quot;A String&quot;,
            ],
            &quot;example&quot;: &quot;&quot;, # Optional. Example of the object. Will only populated when the object is the root.
            &quot;format&quot;: &quot;A String&quot;, # Optional. The format of the data. Supported formats: for NUMBER type: &quot;float&quot;, &quot;double&quot; for INTEGER type: &quot;int32&quot;, &quot;int64&quot; for STRING type: &quot;email&quot;, &quot;byte&quot;, etc
            &quot;items&quot;: # Object with schema name: GoogleCloudAiplatformV1Schema # Optional. SCHEMA FIELDS FOR TYPE ARRAY Schema of the elements of Type.ARRAY.
            &quot;maxItems&quot;: &quot;A String&quot;, # Optional. Maximum number of the elements for Type.ARRAY.
            &quot;maxLength&quot;: &quot;A String&quot;, # Optional. Maximum length of the Type.STRING
            &quot;maxProperties&quot;: &quot;A String&quot;, # Optional. Maximum number of the properties for Type.OBJECT.
            &quot;maximum&quot;: 3.14, # Optional. Maximum value of the Type.INTEGER and Type.NUMBER
            &quot;minItems&quot;: &quot;A String&quot;, # Optional. Minimum number of the elements for Type.ARRAY.
            &quot;minLength&quot;: &quot;A String&quot;, # Optional. SCHEMA FIELDS FOR TYPE STRING Minimum length of the Type.STRING
            &quot;minProperties&quot;: &quot;A String&quot;, # Optional. Minimum number of the properties for Type.OBJECT.
            &quot;minimum&quot;: 3.14, # Optional. SCHEMA FIELDS FOR TYPE INTEGER and NUMBER Minimum value of the Type.INTEGER and Type.NUMBER
            &quot;nullable&quot;: True or False, # Optional. Indicates if the value may be null.
            &quot;pattern&quot;: &quot;A String&quot;, # Optional. Pattern of the Type.STRING to restrict a string to a regular expression.
            &quot;properties&quot;: { # Optional. SCHEMA FIELDS FOR TYPE OBJECT Properties of Type.OBJECT.
              &quot;a_key&quot;: # Object with schema name: GoogleCloudAiplatformV1Schema
            },
            &quot;propertyOrdering&quot;: [ # Optional. The order of the properties. Not a standard field in open api spec. Only used to support the order of the properties.
              &quot;A String&quot;,
            ],
            &quot;ref&quot;: &quot;A String&quot;, # Optional. Allows indirect references between schema nodes. The value should be a valid reference to a child of the root `defs`. For example, the following schema defines a reference to a schema node named &quot;Pet&quot;: type: object properties: pet: ref: #/defs/Pet defs: Pet: type: object properties: name: type: string The value of the &quot;pet&quot; property is a reference to the schema node named &quot;Pet&quot;. See details in https://json-schema.org/understanding-json-schema/structuring
            &quot;required&quot;: [ # Optional. Required properties of Type.OBJECT.
              &quot;A String&quot;,
            ],
            &quot;title&quot;: &quot;A String&quot;, # Optional. The title of the Schema.
            &quot;type&quot;: &quot;A String&quot;, # Optional. The type of the data.
          },
          &quot;responseJsonSchema&quot;: &quot;&quot;, # Optional. Describes the output from this function in JSON Schema format. The value specified by the schema is the response value of the function. This field is mutually exclusive with `response`.
        },
      ],
      &quot;googleMaps&quot;: { # Tool to retrieve public maps data for grounding, powered by Google. # Optional. GoogleMaps tool type. Tool to support Google Maps in Model.
        &quot;enableWidget&quot;: True or False, # Optional. If true, include the widget context token in the response.
      },
      &quot;googleSearch&quot;: { # GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google. # Optional. GoogleSearch tool type. Tool to support Google Search in Model. Powered by Google.
        &quot;blockingConfidence&quot;: &quot;A String&quot;, # Optional. Sites with confidence level chosen &amp; above this value will be blocked from the search results.
        &quot;excludeDomains&quot;: [ # Optional. List of domains to be excluded from the search results. The default limit is 2000 domains. Example: [&quot;amazon.com&quot;, &quot;facebook.com&quot;].
          &quot;A String&quot;,
        ],
      },
      &quot;googleSearchRetrieval&quot;: { # Tool to retrieve public web data for grounding, powered by Google. # Optional. Specialized retrieval tool that is powered by Google Search.
        &quot;dynamicRetrievalConfig&quot;: { # Describes the options to customize dynamic retrieval. # Specifies the dynamic retrieval configuration for the given source.
          &quot;dynamicThreshold&quot;: 3.14, # Optional. The threshold to be used in dynamic retrieval. If not set, a system default value is used.
          &quot;mode&quot;: &quot;A String&quot;, # The mode of the predictor to be used in dynamic retrieval.
        },
      },
      &quot;retrieval&quot;: { # Defines a retrieval tool that model can call to access external knowledge. # Optional. Retrieval tool type. System will always execute the provided retrieval tool(s) to get external knowledge to answer the prompt. Retrieval results are presented to the model for generation.
        &quot;disableAttribution&quot;: True or False, # Optional. Deprecated. This option is no longer supported.
        &quot;externalApi&quot;: { # Retrieve from data source powered by external API for grounding. The external API is not owned by Google, but need to follow the pre-defined API spec. # Use data source powered by external API for grounding.
          &quot;apiAuth&quot;: { # The generic reusable api auth config. Deprecated. Please use AuthConfig (google/cloud/aiplatform/master/auth.proto) instead. # The authentication config to access the API. Deprecated. Please use auth_config instead.
            &quot;apiKeyConfig&quot;: { # The API secret. # The API secret.
              &quot;apiKeySecretVersion&quot;: &quot;A String&quot;, # Required. The SecretManager secret version resource name storing API key. e.g. projects/{project}/secrets/{secret}/versions/{version}
              &quot;apiKeyString&quot;: &quot;A String&quot;, # The API key string. Either this or `api_key_secret_version` must be set.
            },
          },
          &quot;apiSpec&quot;: &quot;A String&quot;, # The API spec that the external API implements.
          &quot;authConfig&quot;: { # Auth configuration to run the extension. # The authentication config to access the API.
            &quot;apiKeyConfig&quot;: { # Config for authentication with API key. # Config for API key auth.
              &quot;apiKeySecret&quot;: &quot;A String&quot;, # Optional. The name of the SecretManager secret version resource storing the API key. Format: `projects/{project}/secrets/{secrete}/versions/{version}` - If both `api_key_secret` and `api_key_string` are specified, this field takes precedence over `api_key_string`. - If specified, the `secretmanager.versions.access` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified resource.
              &quot;apiKeyString&quot;: &quot;A String&quot;, # Optional. The API key to be used in the request directly.
              &quot;httpElementLocation&quot;: &quot;A String&quot;, # Optional. The location of the API key.
              &quot;name&quot;: &quot;A String&quot;, # Optional. The parameter name of the API key. E.g. If the API request is &quot;https://example.com/act?api_key=&quot;, &quot;api_key&quot; would be the parameter name.
            },
            &quot;authType&quot;: &quot;A String&quot;, # Type of auth scheme.
            &quot;googleServiceAccountConfig&quot;: { # Config for Google Service Account Authentication. # Config for Google Service Account auth.
              &quot;serviceAccount&quot;: &quot;A String&quot;, # Optional. The service account that the extension execution service runs as. - If the service account is specified, the `iam.serviceAccounts.getAccessToken` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified service account. - If not specified, the Vertex AI Extension Service Agent will be used to execute the Extension.
            },
            &quot;httpBasicAuthConfig&quot;: { # Config for HTTP Basic Authentication. # Config for HTTP Basic auth.
              &quot;credentialSecret&quot;: &quot;A String&quot;, # Required. The name of the SecretManager secret version resource storing the base64 encoded credentials. Format: `projects/{project}/secrets/{secrete}/versions/{version}` - If specified, the `secretmanager.versions.access` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the specified resource.
            },
            &quot;oauthConfig&quot;: { # Config for user oauth. # Config for user oauth.
              &quot;accessToken&quot;: &quot;A String&quot;, # Access token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time.
              &quot;serviceAccount&quot;: &quot;A String&quot;, # The service account used to generate access tokens for executing the Extension. - If the service account is specified, the `iam.serviceAccounts.getAccessToken` permission should be granted to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents) on the provided service account.
            },
            &quot;oidcConfig&quot;: { # Config for user OIDC auth. # Config for user OIDC auth.
              &quot;idToken&quot;: &quot;A String&quot;, # OpenID Connect formatted ID token for extension endpoint. Only used to propagate token from [[ExecuteExtensionRequest.runtime_auth_config]] at request time.
              &quot;serviceAccount&quot;: &quot;A String&quot;, # The service account used to generate an OpenID Connect (OIDC)-compatible JWT token signed by the Google OIDC Provider (accounts.google.com) for extension endpoint (https://cloud.google.com/iam/docs/create-short-lived-credentials-direct#sa-credentials-oidc). - The audience for the token will be set to the URL in the server url defined in the OpenApi spec. - If the service account is provided, the service account should grant `iam.serviceAccounts.getOpenIdToken` permission to Vertex AI Extension Service Agent (https://cloud.google.com/vertex-ai/docs/general/access-control#service-agents).
            },
          },
          &quot;elasticSearchParams&quot;: { # The search parameters to use for the ELASTIC_SEARCH spec. # Parameters for the elastic search API.
            &quot;index&quot;: &quot;A String&quot;, # The ElasticSearch index to use.
            &quot;numHits&quot;: 42, # Optional. Number of hits (chunks) to request. When specified, it is passed to Elasticsearch as the `num_hits` param.
            &quot;searchTemplate&quot;: &quot;A String&quot;, # The ElasticSearch search template to use.
          },
          &quot;endpoint&quot;: &quot;A String&quot;, # The endpoint of the external API. The system will call the API at this endpoint to retrieve the data for grounding. Example: https://acme.com:443/search
          &quot;simpleSearchParams&quot;: { # The search parameters to use for SIMPLE_SEARCH spec. # Parameters for the simple search API.
          },
        },
        &quot;vertexAiSearch&quot;: { # Retrieve from Vertex AI Search datastore or engine for grounding. datastore and engine are mutually exclusive. See https://cloud.google.com/products/agent-builder # Set to use data source powered by Vertex AI Search.
          &quot;dataStoreSpecs&quot;: [ # Specifications that define the specific DataStores to be searched, along with configurations for those data stores. This is only considered for Engines with multiple data stores. It should only be set if engine is used.
            { # Define data stores within engine to filter on in a search call and configurations for those data stores. For more information, see https://cloud.google.com/generative-ai-app-builder/docs/reference/rpc/google.cloud.discoveryengine.v1#datastorespec
              &quot;dataStore&quot;: &quot;A String&quot;, # Full resource name of DataStore, such as Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}`
              &quot;filter&quot;: &quot;A String&quot;, # Optional. Filter specification to filter documents in the data store specified by data_store field. For more information on filtering, see [Filtering](https://cloud.google.com/generative-ai-app-builder/docs/filter-search-metadata)
            },
          ],
          &quot;datastore&quot;: &quot;A String&quot;, # Optional. Fully-qualified Vertex AI Search data store resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/dataStores/{dataStore}`
          &quot;engine&quot;: &quot;A String&quot;, # Optional. Fully-qualified Vertex AI Search engine resource ID. Format: `projects/{project}/locations/{location}/collections/{collection}/engines/{engine}`
          &quot;filter&quot;: &quot;A String&quot;, # Optional. Filter strings to be passed to the search API.
          &quot;maxResults&quot;: 42, # Optional. Number of search results to return per query. The default value is 10. The maximumm allowed value is 10.
        },
        &quot;vertexRagStore&quot;: { # Retrieve from Vertex RAG Store for grounding. # Set to use data source powered by Vertex RAG store. User data is uploaded via the VertexRagDataService.
          &quot;ragResources&quot;: [ # Optional. The representation of the rag source. It can be used to specify corpus only or ragfiles. Currently only support one corpus or multiple files from one corpus. In the future we may open up multiple corpora support.
            { # The definition of the Rag resource.
              &quot;ragCorpus&quot;: &quot;A String&quot;, # Optional. RagCorpora resource name. Format: `projects/{project}/locations/{location}/ragCorpora/{rag_corpus}`
              &quot;ragFileIds&quot;: [ # Optional. rag_file_id. The files should be in the same rag_corpus set in rag_corpus field.
                &quot;A String&quot;,
              ],
            },
          ],
          &quot;ragRetrievalConfig&quot;: { # Specifies the context retrieval config. # Optional. The retrieval config for the Rag query.
            &quot;filter&quot;: { # Config for filters. # Optional. Config for filters.
              &quot;metadataFilter&quot;: &quot;A String&quot;, # Optional. String for metadata filtering.
              &quot;vectorDistanceThreshold&quot;: 3.14, # Optional. Only returns contexts with vector distance smaller than the threshold.
              &quot;vectorSimilarityThreshold&quot;: 3.14, # Optional. Only returns contexts with vector similarity larger than the threshold.
            },
            &quot;ranking&quot;: { # Config for ranking and reranking. # Optional. Config for ranking and reranking.
              &quot;llmRanker&quot;: { # Config for LlmRanker. # Optional. Config for LlmRanker.
                &quot;modelName&quot;: &quot;A String&quot;, # Optional. The model name used for ranking. See [Supported models](https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/inference#supported-models).
              },
              &quot;rankService&quot;: { # Config for Rank Service. # Optional. Config for Rank Service.
                &quot;modelName&quot;: &quot;A String&quot;, # Optional. The model name of the rank service. Format: `semantic-ranker-512@latest`
              },
            },
            &quot;topK&quot;: 42, # Optional. The number of contexts to retrieve.
          },
          &quot;similarityTopK&quot;: 42, # Optional. Number of top k results to return from the selected corpora.
          &quot;vectorDistanceThreshold&quot;: 3.14, # Optional. Only return results with vector distance smaller than the threshold.
        },
      },
      &quot;urlContext&quot;: { # Tool to support URL context. # Optional. Tool to support URL context retrieval.
      },
    },
  ],
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Response message for [PredictionService.GenerateContent].
  &quot;candidates&quot;: [ # Output only. Generated candidates.
    { # A response candidate generated from the model.
      &quot;avgLogprobs&quot;: 3.14, # Output only. The average log probability of the tokens in this candidate. This is a length-normalized score that can be used to compare the quality of candidates of different lengths. A higher average log probability suggests a more confident and coherent response.
      &quot;citationMetadata&quot;: { # A collection of citations that apply to a piece of generated content. # Output only. A collection of citations that apply to the generated content.
        &quot;citations&quot;: [ # Output only. A list of citations for the content.
          { # A citation for a piece of generatedcontent.
            &quot;endIndex&quot;: 42, # Output only. The end index of the citation in the content.
            &quot;license&quot;: &quot;A String&quot;, # Output only. The license of the source of the citation.
            &quot;publicationDate&quot;: { # Represents a whole or partial calendar date, such as a birthday. The time of day and time zone are either specified elsewhere or are insignificant. The date is relative to the Gregorian Calendar. This can represent one of the following: * A full date, with non-zero year, month, and day values. * A month and day, with a zero year (for example, an anniversary). * A year on its own, with a zero month and a zero day. * A year and month, with a zero day (for example, a credit card expiration date). Related types: * google.type.TimeOfDay * google.type.DateTime * google.protobuf.Timestamp # Output only. The publication date of the source of the citation.
              &quot;day&quot;: 42, # Day of a month. Must be from 1 to 31 and valid for the year and month, or 0 to specify a year by itself or a year and month where the day isn&#x27;t significant.
              &quot;month&quot;: 42, # Month of a year. Must be from 1 to 12, or 0 to specify a year without a month and day.
              &quot;year&quot;: 42, # Year of the date. Must be from 1 to 9999, or 0 to specify a date without a year.
            },
            &quot;startIndex&quot;: 42, # Output only. The start index of the citation in the content.
            &quot;title&quot;: &quot;A String&quot;, # Output only. The title of the source of the citation.
            &quot;uri&quot;: &quot;A String&quot;, # Output only. The URI of the source of the citation.
          },
        ],
      },
      &quot;content&quot;: { # The structured data content of a message. A Content message contains a `role` field, which indicates the producer of the content, and a `parts` field, which contains the multi-part data of the message. # Output only. The content of the candidate.
        &quot;parts&quot;: [ # Required. A list of Part objects that make up a single message. Parts of a message can have different MIME types. A Content message must have at least one Part.
          { # A datatype containing media that is part of a multi-part Content message. A `Part` consists of data which has an associated datatype. A `Part` can only contain one of the accepted types in `Part.data`. For media types that are not text, `Part` must have a fixed IANA MIME type identifying the type and subtype of the media if `inline_data` or `file_data` field is filled with raw bytes.
            &quot;codeExecutionResult&quot;: { # Result of executing the [ExecutableCode]. Only generated when using the [CodeExecution] tool, and always follows a `part` containing the [ExecutableCode]. # Optional. The result of executing the ExecutableCode.
              &quot;outcome&quot;: &quot;A String&quot;, # Required. Outcome of the code execution.
              &quot;output&quot;: &quot;A String&quot;, # Optional. Contains stdout when code execution is successful, stderr or other description otherwise.
            },
            &quot;executableCode&quot;: { # Code generated by the model that is meant to be executed, and the result returned to the model. Generated when using the [CodeExecution] tool, in which the code will be automatically executed, and a corresponding [CodeExecutionResult] will also be generated. # Optional. Code generated by the model that is intended to be executed.
              &quot;code&quot;: &quot;A String&quot;, # Required. The code to be executed.
              &quot;language&quot;: &quot;A String&quot;, # Required. Programming language of the `code`.
            },
            &quot;fileData&quot;: { # URI-based data. A FileData message contains a URI pointing to data of a specific media type. It is used to represent images, audio, and video stored in Google Cloud Storage. # Optional. The URI-based data of the part. This can be used to include files from Google Cloud Storage.
              &quot;displayName&quot;: &quot;A String&quot;, # Optional. The display name of the file. Used to provide a label or filename to distinguish files. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server side tools (`code_execution`, `google_search`, and `url_context`) are enabled.
              &quot;fileUri&quot;: &quot;A String&quot;, # Required. The URI of the file in Google Cloud Storage.
              &quot;mimeType&quot;: &quot;A String&quot;, # Required. The IANA standard MIME type of the source data.
            },
            &quot;functionCall&quot;: { # A predicted [FunctionCall] returned from the model that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing the parameters and their values. # Optional. A predicted function call returned from the model. This contains the name of the function to call and the arguments to pass to the function.
              &quot;args&quot;: { # Optional. The function parameters and values in JSON object format. See [FunctionDeclaration.parameters] for parameter details.
                &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
              },
              &quot;name&quot;: &quot;A String&quot;, # Optional. The name of the function to call. Matches [FunctionDeclaration.name].
            },
            &quot;functionResponse&quot;: { # The result output from a [FunctionCall] that contains a string representing the [FunctionDeclaration.name] and a structured JSON object containing any output from the function is used as context to the model. This should contain the result of a [FunctionCall] made based on model prediction. # Optional. The result of a function call. This is used to provide the model with the result of a function call that it predicted.
              &quot;name&quot;: &quot;A String&quot;, # Required. The name of the function to call. Matches [FunctionDeclaration.name] and [FunctionCall.name].
              &quot;parts&quot;: [ # Optional. Ordered `Parts` that constitute a function response. Parts may have different IANA MIME types.
                { # A datatype containing media that is part of a `FunctionResponse` message. A `FunctionResponsePart` consists of data which has an associated datatype. A `FunctionResponsePart` can only contain one of the accepted types in `FunctionResponsePart.data`. A `FunctionResponsePart` must have a fixed IANA MIME type identifying the type and subtype of the media if the `inline_data` field is filled with raw bytes.
                  &quot;fileData&quot;: { # URI based data for function response. # URI based data.
                    &quot;displayName&quot;: &quot;A String&quot;, # Optional. Display name of the file data. Used to provide a label or filename to distinguish file datas. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled.
                    &quot;fileUri&quot;: &quot;A String&quot;, # Required. URI.
                    &quot;mimeType&quot;: &quot;A String&quot;, # Required. The IANA standard MIME type of the source data.
                  },
                  &quot;inlineData&quot;: { # Raw media bytes for function response. Text should not be sent as raw bytes, use the &#x27;text&#x27; field. # Inline media bytes.
                    &quot;data&quot;: &quot;A String&quot;, # Required. Raw bytes.
                    &quot;displayName&quot;: &quot;A String&quot;, # Optional. Display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in PromptMessage for prompt management. It is currently used in the Gemini GenerateContent calls only when server side tools (code_execution, google_search, and url_context) are enabled.
                    &quot;mimeType&quot;: &quot;A String&quot;, # Required. The IANA standard MIME type of the source data.
                  },
                },
              ],
              &quot;response&quot;: { # Required. The function response in JSON object format. Use &quot;output&quot; key to specify function output and &quot;error&quot; key to specify error details (if any). If &quot;output&quot; and &quot;error&quot; keys are not specified, then whole &quot;response&quot; is treated as function output.
                &quot;a_key&quot;: &quot;&quot;, # Properties of the object.
              },
            },
            &quot;inlineData&quot;: { # A content blob. A Blob contains data of a specific media type. It is used to represent images, audio, and video. # Optional. The inline data content of the part. This can be used to include images, audio, or video in a request.
              &quot;data&quot;: &quot;A String&quot;, # Required. The raw bytes of the data.
              &quot;displayName&quot;: &quot;A String&quot;, # Optional. The display name of the blob. Used to provide a label or filename to distinguish blobs. This field is only returned in `PromptMessage` for prompt management. It is used in the Gemini calls only when server-side tools (`code_execution`, `google_search`, and `url_context`) are enabled.
              &quot;mimeType&quot;: &quot;A String&quot;, # Required. The IANA standard MIME type of the source data.
            },
            &quot;text&quot;: &quot;A String&quot;, # Optional. The text content of the part.
            &quot;thought&quot;: True or False, # Optional. Indicates whether the `part` represents the model&#x27;s thought process or reasoning.
            &quot;thoughtSignature&quot;: &quot;A String&quot;, # Optional. An opaque signature for the thought so it can be reused in subsequent requests.
            &quot;videoMetadata&quot;: { # Provides metadata for a video, including the start and end offsets for clipping and the frame rate. # Optional. Video metadata. The metadata should only be specified while the video data is presented in inline_data or file_data.
              &quot;endOffset&quot;: &quot;A String&quot;, # Optional. The end offset of the video.
              &quot;fps&quot;: 3.14, # Optional. The frame rate of the video sent to the model. If not specified, the default value is 1.0. The valid range is (0.0, 24.0].
              &quot;startOffset&quot;: &quot;A String&quot;, # Optional. The start offset of the video.
            },
          },
        ],
        &quot;role&quot;: &quot;A String&quot;, # Optional. The producer of the content. Must be either &#x27;user&#x27; or &#x27;model&#x27;. If not set, the service will default to &#x27;user&#x27;.
      },
      &quot;finishMessage&quot;: &quot;A String&quot;, # Output only. Describes the reason the model stopped generating tokens in more detail. This field is returned only when `finish_reason` is set.
      &quot;finishReason&quot;: &quot;A String&quot;, # Output only. The reason why the model stopped generating tokens. If empty, the model has not stopped generating.
      &quot;groundingMetadata&quot;: { # Information about the sources that support the content of a response. When grounding is enabled, the model returns citations for claims in the response. This object contains the retrieved sources. # Output only. Metadata returned when grounding is enabled. It contains the sources used to ground the generated content.
        &quot;googleMapsWidgetContextToken&quot;: &quot;A String&quot;, # Optional. Output only. A token that can be used to render a Google Maps widget with the contextual data. This field is populated only when the grounding source is Google Maps.
        &quot;groundingChunks&quot;: [ # A list of supporting references retrieved from the grounding source. This field is populated when the grounding source is Google Search, Vertex AI Search, or Google Maps.
          { # A piece of evidence that supports a claim made by the model. This is used to show a citation for a claim made by the model. When grounding is enabled, the model returns a `GroundingChunk` that contains a reference to the source of the information.
            &quot;maps&quot;: { # A `Maps` chunk is a piece of evidence that comes from Google Maps. It contains information about a place, such as its name, address, and reviews. This is used to provide the user with rich, location-based information. # A grounding chunk from Google Maps. See the `Maps` message for details.
              &quot;placeAnswerSources&quot;: { # The sources that were used to generate the place answer. This includes review snippets and photos that were used to generate the answer, as well as URIs to flag content. # The sources that were used to generate the place answer. This includes review snippets and photos that were used to generate the answer, as well as URIs to flag content.
                &quot;reviewSnippets&quot;: [ # Snippets of reviews that were used to generate the answer.
                  { # A review snippet that is used to generate the answer.
                    &quot;googleMapsUri&quot;: &quot;A String&quot;, # A link to show the review on Google Maps.
                    &quot;reviewId&quot;: &quot;A String&quot;, # The ID of the review that is being referenced.
                    &quot;title&quot;: &quot;A String&quot;, # The title of the review.
                  },
                ],
              },
              &quot;placeId&quot;: &quot;A String&quot;, # This Place&#x27;s resource name, in `places/{place_id}` format. This can be used to look up the place in the Google Maps API.
              &quot;text&quot;: &quot;A String&quot;, # The text of the place answer.
              &quot;title&quot;: &quot;A String&quot;, # The title of the place.
              &quot;uri&quot;: &quot;A String&quot;, # The URI of the place.
            },
            &quot;retrievedContext&quot;: { # Context retrieved from a data source to ground the model&#x27;s response. This is used when a retrieval tool fetches information from a user-provided corpus or a public dataset. # A grounding chunk from a data source retrieved by a retrieval tool, such as Vertex AI Search. See the `RetrievedContext` message for details
              &quot;documentName&quot;: &quot;A String&quot;, # Output only. The full resource name of the referenced Vertex AI Search document. This is used to identify the specific document that was retrieved. The format is `projects/{project}/locations/{location}/collections/{collection}/dataStores/{data_store}/branches/{branch}/documents/{document}`.
              &quot;ragChunk&quot;: { # A RagChunk includes the content of a chunk of a RagFile, and associated metadata. # Additional context for a Retrieval-Augmented Generation (RAG) retrieval result. This is populated only when the RAG retrieval tool is used.
                &quot;pageSpan&quot;: { # Represents where the chunk starts and ends in the document. # If populated, represents where the chunk starts and ends in the document.
                  &quot;firstPage&quot;: 42, # Page where chunk starts in the document. Inclusive. 1-indexed.
                  &quot;lastPage&quot;: 42, # Page where chunk ends in the document. Inclusive. 1-indexed.
                },
                &quot;text&quot;: &quot;A String&quot;, # The content of the chunk.
              },
              &quot;text&quot;: &quot;A String&quot;, # The content of the retrieved data source.
              &quot;title&quot;: &quot;A String&quot;, # The title of the retrieved data source.
              &quot;uri&quot;: &quot;A String&quot;, # The URI of the retrieved data source.
            },
            &quot;web&quot;: { # A `Web` chunk is a piece of evidence that comes from a web page. It contains the URI of the web page, the title of the page, and the domain of the page. This is used to provide the user with a link to the source of the information. # A grounding chunk from a web page, typically from Google Search. See the `Web` message for details.
              &quot;domain&quot;: &quot;A String&quot;, # The domain of the web page that contains the evidence. This can be used to filter out low-quality sources.
              &quot;title&quot;: &quot;A String&quot;, # The title of the web page that contains the evidence.
              &quot;uri&quot;: &quot;A String&quot;, # The URI of the web page that contains the evidence.
            },
          },
        ],
        &quot;groundingSupports&quot;: [ # Optional. A list of grounding supports that connect the generated content to the grounding chunks. This field is populated when the grounding source is Google Search or Vertex AI Search.
          { # A collection of supporting references for a segment of the model&#x27;s response.
            &quot;confidenceScores&quot;: [ # The confidence scores for the support references. This list is parallel to the `grounding_chunk_indices` list. A score is a value between 0.0 and 1.0, with a higher score indicating a higher confidence that the reference supports the claim. For Gemini 2.0 and before, this list has the same size as `grounding_chunk_indices`. For Gemini 2.5 and later, this list is empty and should be ignored.
              3.14,
            ],
            &quot;groundingChunkIndices&quot;: [ # A list of indices into the `grounding_chunks` field of the `GroundingMetadata` message. These indices specify which grounding chunks support the claim made in the content segment. For example, if this field has the values `[1, 3]`, it means that `grounding_chunks[1]` and `grounding_chunks[3]` are the sources for the claim in the content segment.
              42,
            ],
            &quot;segment&quot;: { # A segment of the content. # The content segment that this support message applies to.
              &quot;endIndex&quot;: 42, # Output only. The end index of the segment in the `Part`, measured in bytes. This marks the end of the segment and is exclusive, meaning the segment includes content up to, but not including, the byte at this index.
              &quot;partIndex&quot;: 42, # Output only. The index of the `Part` object that this segment belongs to. This is useful for associating the segment with a specific part of the content.
              &quot;startIndex&quot;: 42, # Output only. The start index of the segment in the `Part`, measured in bytes. This marks the beginning of the segment and is inclusive, meaning the byte at this index is the first byte of the segment.
              &quot;text&quot;: &quot;A String&quot;, # Output only. The text of the segment.
            },
          },
        ],
        &quot;retrievalMetadata&quot;: { # Metadata related to the retrieval grounding source. This is part of the `GroundingMetadata` returned when grounding is enabled. # Optional. Output only. Metadata related to the retrieval grounding source.
          &quot;googleSearchDynamicRetrievalScore&quot;: 3.14, # Optional. A score indicating how likely it is that a Google Search query could help answer the prompt. The score is in the range of `[0, 1]`. A score of 1 means the model is confident that a search will be helpful, and 0 means it is not. This score is populated only when Google Search grounding and dynamic retrieval are enabled. The score is used to determine whether to trigger a search.
        },
        &quot;searchEntryPoint&quot;: { # An entry point for displaying Google Search results. A `SearchEntryPoint` is populated when the grounding source for a model&#x27;s response is Google Search. It provides information that you can use to display the search results in your application. # Optional. A web search entry point that can be used to display search results. This field is populated only when the grounding source is Google Search.
          &quot;renderedContent&quot;: &quot;A String&quot;, # Optional. An HTML snippet that can be embedded in a web page or an application&#x27;s webview. This snippet displays a search result, including the title, URL, and a brief description of the search result.
          &quot;sdkBlob&quot;: &quot;A String&quot;, # Optional. A base64-encoded JSON object that contains a list of search queries and their corresponding search URLs. This information can be used to build a custom search UI.
        },
        &quot;sourceFlaggingUris&quot;: [ # Optional. Output only. A list of URIs that can be used to flag a place or review for inappropriate content. This field is populated only when the grounding source is Google Maps.
          { # A URI that can be used to flag a place or review for inappropriate content. This is populated only when the grounding source is Google Maps.
            &quot;flagContentUri&quot;: &quot;A String&quot;, # The URI that can be used to flag the content.
            &quot;sourceId&quot;: &quot;A String&quot;, # The ID of the place or review.
          },
        ],
        &quot;webSearchQueries&quot;: [ # Optional. The web search queries that were used to generate the content. This field is populated only when the grounding source is Google Search.
          &quot;A String&quot;,
        ],
      },
      &quot;index&quot;: 42, # Output only. The 0-based index of this candidate in the list of generated responses. This is useful for distinguishing between multiple candidates when `candidate_count` &gt; 1.
      &quot;logprobsResult&quot;: { # The log probabilities of the tokens generated by the model. This is useful for understanding the model&#x27;s confidence in its predictions and for debugging. For example, you can use log probabilities to identify when the model is making a less confident prediction or to explore alternative responses that the model considered. A low log probability can also indicate that the model is &quot;hallucinating&quot; or generating factually incorrect information. # Output only. The detailed log probability information for the tokens in this candidate. This is useful for debugging, understanding model uncertainty, and identifying potential &quot;hallucinations&quot;.
        &quot;chosenCandidates&quot;: [ # A list of the chosen candidate tokens at each decoding step. The length of this list is equal to the total number of decoding steps. Note that the chosen candidate might not be in `top_candidates`.
          { # A single token and its associated log probability.
            &quot;logProbability&quot;: 3.14, # The log probability of this token. A higher value indicates that the model was more confident in this token. The log probability can be used to assess the relative likelihood of different tokens and to identify when the model is uncertain.
            &quot;token&quot;: &quot;A String&quot;, # The token&#x27;s string representation.
            &quot;tokenId&quot;: 42, # The token&#x27;s numerical ID. While the `token` field provides the string representation of the token, the `token_id` is the numerical representation that the model uses internally. This can be useful for developers who want to build custom logic based on the model&#x27;s vocabulary.
          },
        ],
        &quot;topCandidates&quot;: [ # A list of the top candidate tokens at each decoding step. The length of this list is equal to the total number of decoding steps.
          { # A list of the top candidate tokens and their log probabilities at each decoding step. This can be used to see what other tokens the model considered.
            &quot;candidates&quot;: [ # The list of candidate tokens, sorted by log probability in descending order.
              { # A single token and its associated log probability.
                &quot;logProbability&quot;: 3.14, # The log probability of this token. A higher value indicates that the model was more confident in this token. The log probability can be used to assess the relative likelihood of different tokens and to identify when the model is uncertain.
                &quot;token&quot;: &quot;A String&quot;, # The token&#x27;s string representation.
                &quot;tokenId&quot;: 42, # The token&#x27;s numerical ID. While the `token` field provides the string representation of the token, the `token_id` is the numerical representation that the model uses internally. This can be useful for developers who want to build custom logic based on the model&#x27;s vocabulary.
              },
            ],
          },
        ],
      },
      &quot;safetyRatings&quot;: [ # Output only. A list of ratings for the safety of a response candidate. There is at most one rating per category.
        { # A safety rating for a piece of content. The safety rating contains the harm category and the harm probability level.
          &quot;blocked&quot;: True or False, # Output only. Indicates whether the content was blocked because of this rating.
          &quot;category&quot;: &quot;A String&quot;, # Output only. The harm category of this rating.
          &quot;overwrittenThreshold&quot;: &quot;A String&quot;, # Output only. The overwritten threshold for the safety category of Gemini 2.0 image out. If minors are detected in the output image, the threshold of each safety category will be overwritten if user sets a lower threshold.
          &quot;probability&quot;: &quot;A String&quot;, # Output only. The probability of harm for this category.
          &quot;probabilityScore&quot;: 3.14, # Output only. The probability score of harm for this category.
          &quot;severity&quot;: &quot;A String&quot;, # Output only. The severity of harm for this category.
          &quot;severityScore&quot;: 3.14, # Output only. The severity score of harm for this category.
        },
      ],
      &quot;urlContextMetadata&quot;: { # Metadata returned when the model uses the `url_context` tool to get information from a user-provided URL. # Output only. Metadata returned when the model uses the `url_context` tool to get information from a user-provided URL.
        &quot;urlMetadata&quot;: [ # Output only. A list of URL metadata, with one entry for each URL retrieved by the tool.
          { # The metadata for a single URL retrieval.
            &quot;retrievedUrl&quot;: &quot;A String&quot;, # The URL retrieved by the tool.
            &quot;urlRetrievalStatus&quot;: &quot;A String&quot;, # The status of the URL retrieval.
          },
        ],
      },
    },
  ],
  &quot;createTime&quot;: &quot;A String&quot;, # Output only. Timestamp when the request is made to the server.
  &quot;modelVersion&quot;: &quot;A String&quot;, # Output only. The model version used to generate the response.
  &quot;promptFeedback&quot;: { # Content filter results for a prompt sent in the request. Note: This is sent only in the first stream chunk and only if no candidates were generated due to content violations. # Output only. Content filter results for a prompt sent in the request. Note: Sent only in the first stream chunk. Only happens when no candidates were generated due to content violations.
    &quot;blockReason&quot;: &quot;A String&quot;, # Output only. The reason why the prompt was blocked.
    &quot;blockReasonMessage&quot;: &quot;A String&quot;, # Output only. A readable message that explains the reason why the prompt was blocked.
    &quot;safetyRatings&quot;: [ # Output only. A list of safety ratings for the prompt. There is one rating per category.
      { # A safety rating for a piece of content. The safety rating contains the harm category and the harm probability level.
        &quot;blocked&quot;: True or False, # Output only. Indicates whether the content was blocked because of this rating.
        &quot;category&quot;: &quot;A String&quot;, # Output only. The harm category of this rating.
        &quot;overwrittenThreshold&quot;: &quot;A String&quot;, # Output only. The overwritten threshold for the safety category of Gemini 2.0 image out. If minors are detected in the output image, the threshold of each safety category will be overwritten if user sets a lower threshold.
        &quot;probability&quot;: &quot;A String&quot;, # Output only. The probability of harm for this category.
        &quot;probabilityScore&quot;: 3.14, # Output only. The probability score of harm for this category.
        &quot;severity&quot;: &quot;A String&quot;, # Output only. The severity of harm for this category.
        &quot;severityScore&quot;: 3.14, # Output only. The severity score of harm for this category.
      },
    ],
  },
  &quot;responseId&quot;: &quot;A String&quot;, # Output only. response_id is used to identify each response. It is the encoding of the event_id.
  &quot;usageMetadata&quot;: { # Usage metadata about the content generation request and response. This message provides a detailed breakdown of token usage and other relevant metrics. # Usage metadata about the response(s).
    &quot;cacheTokensDetails&quot;: [ # Output only. A detailed breakdown of the token count for each modality in the cached content.
      { # Represents a breakdown of token usage by modality. This message is used in CountTokensResponse and GenerateContentResponse.UsageMetadata to provide a detailed view of how many tokens are used by each modality (e.g., text, image, video) in a request. This is particularly useful for multimodal models, allowing you to track and manage token consumption for billing and quota purposes.
        &quot;modality&quot;: &quot;A String&quot;, # The modality that this token count applies to.
        &quot;tokenCount&quot;: 42, # The number of tokens counted for this modality.
      },
    ],
    &quot;cachedContentTokenCount&quot;: 42, # Output only. The number of tokens in the cached content that was used for this request.
    &quot;candidatesTokenCount&quot;: 42, # The total number of tokens in the generated candidates.
    &quot;candidatesTokensDetails&quot;: [ # Output only. A detailed breakdown of the token count for each modality in the generated candidates.
      { # Represents a breakdown of token usage by modality. This message is used in CountTokensResponse and GenerateContentResponse.UsageMetadata to provide a detailed view of how many tokens are used by each modality (e.g., text, image, video) in a request. This is particularly useful for multimodal models, allowing you to track and manage token consumption for billing and quota purposes.
        &quot;modality&quot;: &quot;A String&quot;, # The modality that this token count applies to.
        &quot;tokenCount&quot;: 42, # The number of tokens counted for this modality.
      },
    ],
    &quot;promptTokenCount&quot;: 42, # The total number of tokens in the prompt. This includes any text, images, or other media provided in the request. When `cached_content` is set, this also includes the number of tokens in the cached content.
    &quot;promptTokensDetails&quot;: [ # Output only. A detailed breakdown of the token count for each modality in the prompt.
      { # Represents a breakdown of token usage by modality. This message is used in CountTokensResponse and GenerateContentResponse.UsageMetadata to provide a detailed view of how many tokens are used by each modality (e.g., text, image, video) in a request. This is particularly useful for multimodal models, allowing you to track and manage token consumption for billing and quota purposes.
        &quot;modality&quot;: &quot;A String&quot;, # The modality that this token count applies to.
        &quot;tokenCount&quot;: 42, # The number of tokens counted for this modality.
      },
    ],
    &quot;thoughtsTokenCount&quot;: 42, # Output only. The number of tokens that were part of the model&#x27;s generated &quot;thoughts&quot; output, if applicable.
    &quot;toolUsePromptTokenCount&quot;: 42, # Output only. The number of tokens in the results from tool executions, which are provided back to the model as input, if applicable.
    &quot;toolUsePromptTokensDetails&quot;: [ # Output only. A detailed breakdown by modality of the token counts from the results of tool executions, which are provided back to the model as input.
      { # Represents a breakdown of token usage by modality. This message is used in CountTokensResponse and GenerateContentResponse.UsageMetadata to provide a detailed view of how many tokens are used by each modality (e.g., text, image, video) in a request. This is particularly useful for multimodal models, allowing you to track and manage token consumption for billing and quota purposes.
        &quot;modality&quot;: &quot;A String&quot;, # The modality that this token count applies to.
        &quot;tokenCount&quot;: 42, # The number of tokens counted for this modality.
      },
    ],
    &quot;totalTokenCount&quot;: 42, # The total number of tokens for the entire request. This is the sum of `prompt_token_count`, `candidates_token_count`, `tool_use_prompt_token_count`, and `thoughts_token_count`.
    &quot;trafficType&quot;: &quot;A String&quot;, # Output only. The traffic type for this request.
  },
}</pre>
</div>

</body></html>